saw commit of vapier@busybox.net (thanks!),
[oweals/busybox.git] / shell / cmdedit.c
index 93758c9fbdc6bd6d368eff8e423029b90ea5c929..32001324fa5667639d76239810cdce3d5fe00e2c 100644 (file)
@@ -58,9 +58,8 @@
 
 #if ENABLE_FEATURE_COMMAND_EDITING
 
-#if ENABLE_FEATURE_COMMAND_USERNAME_COMPLETION || ENABLE_FEATURE_SH_FANCY_PROMPT
-#define ENABLE_FEATURE_GETUSERNAME_AND_HOMEDIR 1
-#endif
+#define ENABLE_FEATURE_GETUSERNAME_AND_HOMEDIR \
+(ENABLE_FEATURE_COMMAND_USERNAME_COMPLETION || ENABLE_FEATURE_SH_FANCY_PROMPT)
 
 /* Maximum length of the linked list for the command line history */
 #if !ENABLE_FEATURE_COMMAND_HISTORY
@@ -984,7 +983,7 @@ static void showfiles(void)
 
                for (nc = 1; nc < ncols && n+nrows < nfiles; n += nrows, nc++) {
                        printf("%s%-*s", matches[n],
-                               column_width - strlen(matches[n]), "");
+                               (int)(column_width - strlen(matches[n])), "");
                }
                printf("%s\n", matches[n]);
        }
@@ -1800,7 +1799,7 @@ rewrite_line:
                        /* After max history, remove the oldest command */
                if (i >= MAX_HISTORY) {
                        free(history[0]);
-                       for(i = 0; i < MAX_HISTORY-1; i++)
+                       for (i = 0; i < MAX_HISTORY-1; i++)
                                history[i] = history[i+1];
                }
                history[i++] = xstrdup(command);