From 9f0572692b53a1a2393a1af72b09e9b5aa8a28a5 Mon Sep 17 00:00:00 2001 From: Anisse Astier Date: Sun, 27 Nov 2016 19:50:56 +0100 Subject: [PATCH] command-not-found: Always return an error (#566) Fixes #564 --- packages/command-not-found/command-not-found.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/command-not-found/command-not-found.c b/packages/command-not-found/command-not-found.c index 42e4e4823..acfbe5845 100644 --- a/packages/command-not-found/command-not-found.c +++ b/packages/command-not-found/command-not-found.c @@ -43,7 +43,7 @@ int main(int argc, char** argv) { int distance = termux_levenshtein_distance(command_not_found, binary_name); if (distance == 0 && strcmp(command_not_found, binary_name) == 0) { printf("The program '%s' is not installed. Install it by executing:\n apt install %s\n", binary_name, current_package); - return 0; + return 127; } else if (best_distance == distance) { guesses_at_best_distance++; } else if (best_distance == -1 || best_distance > distance) { @@ -80,5 +80,6 @@ int main(int argc, char** argv) { } } } + return 127; }