diff options
Diffstat (limited to 'shell/msh.c')
-rw-r--r-- | shell/msh.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/shell/msh.c b/shell/msh.c index 7efd7f96e..32953f4ed 100644 --- a/shell/msh.c +++ b/shell/msh.c | |||
@@ -45,9 +45,9 @@ | |||
45 | # define NOT_LONE_DASH(s) ((s)[0] != '-' || (s)[1]) | 45 | # define NOT_LONE_DASH(s) ((s)[0] != '-' || (s)[1]) |
46 | # define LONE_CHAR(s,c) ((s)[0] == (c) && !(s)[1]) | 46 | # define LONE_CHAR(s,c) ((s)[0] == (c) && !(s)[1]) |
47 | # define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) | 47 | # define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) |
48 | static char *find_applet_by_name(const char *applet) | 48 | static int find_applet_by_name(const char *applet) |
49 | { | 49 | { |
50 | return NULL; | 50 | return -1; |
51 | } | 51 | } |
52 | static char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) | 52 | static char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) |
53 | { | 53 | { |
@@ -83,7 +83,7 @@ static char *itoa(int n) | |||
83 | return local_buf; | 83 | return local_buf; |
84 | } | 84 | } |
85 | #else | 85 | #else |
86 | # include "busybox.h" | 86 | # include "busybox.h" /* for applet_names */ |
87 | extern char **environ; | 87 | extern char **environ; |
88 | #endif | 88 | #endif |
89 | 89 | ||
@@ -3057,7 +3057,7 @@ static const char *rexecve(char *c, char **v, char **envp) | |||
3057 | char *name = c; | 3057 | char *name = c; |
3058 | 3058 | ||
3059 | if (ENABLE_FEATURE_SH_STANDALONE) { | 3059 | if (ENABLE_FEATURE_SH_STANDALONE) { |
3060 | if (find_applet_by_name(name)) { | 3060 | if (find_applet_by_name(name) >= 0) { |
3061 | /* We have to exec here since we vforked. Running | 3061 | /* We have to exec here since we vforked. Running |
3062 | * run_applet_and_exit() won't work and bad things | 3062 | * run_applet_and_exit() won't work and bad things |
3063 | * will happen. */ | 3063 | * will happen. */ |
@@ -3188,15 +3188,15 @@ static int dohelp(struct op *t) | |||
3188 | } | 3188 | } |
3189 | #if ENABLE_FEATURE_SH_STANDALONE | 3189 | #if ENABLE_FEATURE_SH_STANDALONE |
3190 | { | 3190 | { |
3191 | const struct bb_applet *applet = applets; | 3191 | const char *applet = applet_names; |
3192 | 3192 | ||
3193 | while (applet->name) { | 3193 | while (*applet) { |
3194 | col += printf("%c%s", ((col == 0) ? '\t' : ' '), applet->name); | 3194 | col += printf("%c%s", ((col == 0) ? '\t' : ' '), applet); |
3195 | if (col > 60) { | 3195 | if (col > 60) { |
3196 | bb_putchar('\n'); | 3196 | bb_putchar('\n'); |
3197 | col = 0; | 3197 | col = 0; |
3198 | } | 3198 | } |
3199 | applet++; | 3199 | applet += strlen(applet) + 1; |
3200 | } | 3200 | } |
3201 | } | 3201 | } |
3202 | #endif | 3202 | #endif |