colordiff: Update from 1.0.16 to 1.0.18
[termux-packages] / packages / command-not-found / command-not-found.c
index b06c8c7..6a02347 100644 (file)
@@ -4,11 +4,11 @@
 
 #include "commands.h"
 
-inline int termux_min3(unsigned int a, unsigned int b, unsigned int c) {
+static inline int termux_min3(unsigned int a, unsigned int b, unsigned int c) {
        return (a < b ? (a < c ? a : c) : (b < c ? b : c));
 }
 
-int termux_levenshtein_distance(char const* restrict s1, char const* restrict s2) {
+static int termux_levenshtein_distance(char const* restrict s1, char const* restrict s2) {
        unsigned int s1len = strlen(s1);
        unsigned int s2len = strlen(s2);
        unsigned int matrix[s2len+1][s1len+1];
@@ -42,8 +42,8 @@ int main(int argc, char** argv) {
                        char const* binary_name = current_line + 1;
                        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 currently not installed. You can install it by executing:\n apt install %s\n", binary_name, current_package);
-                               return 0;
+                               printf("The program '%s' is not installed. Install it by executing:\n packages install %s\n", binary_name, current_package);
+                               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;
 }