diff options
Diffstat (limited to 'shell/cmdedit.c')
-rw-r--r-- | shell/cmdedit.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 884489b45..ec861df54 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -43,6 +43,8 @@ | |||
43 | 43 | ||
44 | #include "busybox.h" | 44 | #include "busybox.h" |
45 | 45 | ||
46 | #include "../shell/cmdedit.h" | ||
47 | |||
46 | #ifdef CONFIG_LOCALE_SUPPORT | 48 | #ifdef CONFIG_LOCALE_SUPPORT |
47 | #define Isprint(c) isprint((c)) | 49 | #define Isprint(c) isprint((c)) |
48 | #else | 50 | #else |
@@ -609,14 +611,20 @@ enum { | |||
609 | FIND_FILE_ONLY = 2, | 611 | FIND_FILE_ONLY = 2, |
610 | }; | 612 | }; |
611 | 613 | ||
614 | #ifdef CONFIG_ASH | ||
615 | const char *cmdedit_path_lookup; | ||
616 | #else | ||
617 | #define cmdedit_path_lookup getenv("PATH") | ||
618 | #endif | ||
619 | |||
612 | static int path_parse(char ***p, int flags) | 620 | static int path_parse(char ***p, int flags) |
613 | { | 621 | { |
614 | int npth; | 622 | int npth; |
615 | char *tmp; | 623 | const char *tmp; |
616 | char *pth; | 624 | const char *pth; |
617 | 625 | ||
618 | /* if not setenv PATH variable, to search cur dir "." */ | 626 | /* if not setenv PATH variable, to search cur dir "." */ |
619 | if (flags != FIND_EXE_ONLY || (pth = getenv("PATH")) == 0 || | 627 | if (flags != FIND_EXE_ONLY || (pth = cmdedit_path_lookup) == 0 || |
620 | /* PATH=<empty> or PATH=:<empty> */ | 628 | /* PATH=<empty> or PATH=:<empty> */ |
621 | *pth == 0 || (*pth == ':' && *(pth + 1) == 0)) { | 629 | *pth == 0 || (*pth == ':' && *(pth + 1) == 0)) { |
622 | return 1; | 630 | return 1; |