lineedit: autocompletion for embedded scripts
No binary (build failed)
—
(log yok)
| @@ -812,14 +812,20 @@ static NOINLINE unsigned complete_cmd_dir_file(const char *command, int type) | |
| } | |
| pf_len = strlen(pfind); | |
| - | # if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1 |
| + | # if ENABLE_FEATURE_SH_STANDALONE && (NUM_APPLETS != 1 || NUM_SCRIPTS > 0) |
| if (type == FIND_EXE_ONLY && !dirbuf) { | |
| - | const char *p = applet_names; |
| - | |
| + | const char *p; |
| + | # if NUM_APPLETS != 1 && NUM_SCRIPTS > 0 |
| + | for (i = 0, p = applet_names; i < 2; i++, p = script_names) |
| + | # elif NUM_APPLETS != 1 /* and NUM_SCRIPTS == 0 */ |
| + | p = applet_names; |
| + | # else /* NUM_APPLETS == 1 && NUM_SCRIPTS > 0 */ |
| + | p = script_names; |
| + | # endif |
| while (*p) { | |
| if (strncmp(pfind, p, pf_len) == 0) | |
| add_match(xstrdup(p)); | |
| - | while (*p++ != '\0') |
| + | while (*p++) |
| continue; | |
| } | |
| } | |