diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-02-15 12:40:30 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-02-15 12:40:30 +0000 |
commit | 8ad78e1ec7b2e873953f9f476fb63b5893526c39 (patch) | |
tree | 162818ac9d83a06d91714855b0d0f87b8436c238 | |
parent | c6ab0850027e65b2ce880da1527690e2a5f93b03 (diff) | |
download | busybox-w32-8ad78e1ec7b2e873953f9f476fb63b5893526c39.tar.gz busybox-w32-8ad78e1ec7b2e873953f9f476fb63b5893526c39.tar.bz2 busybox-w32-8ad78e1ec7b2e873953f9f476fb63b5893526c39.zip |
ash: make dot command search current directory first, as bash does.
-rw-r--r-- | shell/ash.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index 492ccd79f..3abca75fe 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -11828,7 +11828,16 @@ find_dot_file(char *name) | |||
11828 | if (strchr(name, '/')) | 11828 | if (strchr(name, '/')) |
11829 | return name; | 11829 | return name; |
11830 | 11830 | ||
11831 | /* IIRC standards do not say whether . is to be searched. | ||
11832 | * And it is even smaller this way, making it unconditional for now: | ||
11833 | */ | ||
11834 | if (1) { /* ENABLE_ASH_BASH_COMPAT */ | ||
11835 | fullname = name; | ||
11836 | goto try_cur_dir; | ||
11837 | } | ||
11838 | |||
11831 | while ((fullname = padvance(&path, name)) != NULL) { | 11839 | while ((fullname = padvance(&path, name)) != NULL) { |
11840 | try_cur_dir: | ||
11832 | if ((stat(fullname, &statb) == 0) && S_ISREG(statb.st_mode)) { | 11841 | if ((stat(fullname, &statb) == 0) && S_ISREG(statb.st_mode)) { |
11833 | /* | 11842 | /* |
11834 | * Don't bother freeing here, since it will | 11843 | * Don't bother freeing here, since it will |