diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 0a5899537..f7fc35225 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -853,6 +853,12 @@ enum { FIND_FILE_ONLY = 2 }; +#ifndef __GNO__ +# define PATH_SEP ':' +#else +# define PATH_SEP ' ' +#endif + static int path_parse(char ***p) { int npth; @@ -872,7 +878,7 @@ static int path_parse(char ***p) tmp = (char*)pth; npth = 1; /* path component count */ while (1) { - tmp = strchr(tmp, ':'); + tmp = strchr(tmp, PATH_SEP); if (!tmp) break; tmp++; @@ -885,7 +891,7 @@ static int path_parse(char ***p) res[0] = tmp = xstrdup(pth); npth = 1; while (1) { - tmp = strchr(tmp, ':'); + tmp = strchr(tmp, PATH_SEP); if (!tmp) break; *tmp++ = '\0'; /* ':' -> '\0' */ diff --git a/shell/hush.c b/shell/hush.c index 763187bf2..adb8af9ae 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -6512,6 +6512,7 @@ static void restore_redirects(int squirrel[]) static char *find_in_path(const char *arg) { char *ret = NULL; +#ifndef __GNO__ const char *PATH = get_local_var_value("PATH"); if (!PATH) @@ -6538,6 +6539,13 @@ static char *find_in_path(const char *arg) } PATH = end + 1; } +#else + ret = buildPath(arg); + if (ret && access(ret, F_OK) != 0) { + free(ret); + return NULL; + } +#endif return ret; }