command-not-found: Always return an error (#566)

Fixes #564
This commit is contained in:
Anisse Astier 2016-11-27 19:50:56 +01:00 committed by Fredrik Fornwall
parent a9d534f91d
commit 9f0572692b

View File

@ -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;
}