Code

remove ugly shadowing of loop indexes in subloops.
[git.git] / help.c
diff --git a/help.c b/help.c
index fb731cc9345e197e710aea611e9519f1e04e0ab8..9ecdefdb03be7fac8d9283c93f2320f71bd062d6 100644 (file)
--- a/help.c
+++ b/help.c
@@ -14,7 +14,7 @@
 static int term_columns(void)
 {
        char *col_string = getenv("COLUMNS");
-       int n_cols = 0;
+       int n_cols;
 
        if (col_string && (n_cols = atoi(col_string)) > 0)
                return n_cols;
@@ -140,7 +140,7 @@ static void list_commands(const char *exec_path, const char *pattern)
                        continue;
 
                entlen = strlen(de->d_name);
-               if (4 < entlen && !strcmp(de->d_name + entlen - 4, ".exe"))
+               if (has_extension(de->d_name, ".exe"))
                        entlen -= 4;
 
                if (longest < entlen)