wok view busybox/stuff/busybox-1.27-ash.u @ rev 19996

Up busybox (1.27.1)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jul 22 18:55:04 2017 +0200 (2017-07-22)
parents
children c0f288d8f56b
line source
1 Some SliTaz scripts (cook) need that...
2 --- busybox-1.27/shell/ash.c
3 +++ busybox-1.27/shell/ash.c
4 @@ -12632,7 +12632,8 @@
5 if (strchr(name, '/'))
6 return name;
8 - while ((fullname = path_advance(&path, name)) != NULL) {
9 + fullname = name; /* search in . first */
10 + do {
11 if ((stat(fullname, &statb) == 0) && S_ISREG(statb.st_mode)) {
12 /*
13 * Don't bother freeing here, since it will
14 @@ -12642,7 +12643,7 @@
15 }
16 if (fullname != name)
17 stunalloc(fullname);
18 - }
19 + } while ((fullname = path_advance(&path, name)) != NULL);
21 /* not found in the PATH */
22 ash_msg_and_raise_error("%s: not found", name);