svn commit: trunk/busybox/shell

vda at busybox.net vda at busybox.net
Sun Feb 15 12:40:30 UTC 2009


Author: vda
Date: 2009-02-15 12:40:30 +0000 (Sun, 15 Feb 2009)
New Revision: 25341

Log:
ash: make dot command search current directory first, as bash does.



Modified:
   trunk/busybox/shell/ash.c


Changeset:
Modified: trunk/busybox/shell/ash.c
===================================================================
--- trunk/busybox/shell/ash.c	2009-02-15 12:01:14 UTC (rev 25340)
+++ trunk/busybox/shell/ash.c	2009-02-15 12:40:30 UTC (rev 25341)
@@ -11828,7 +11828,16 @@
 	if (strchr(name, '/'))
 		return name;
 
+	/* IIRC standards do not say whether . is to be searched.
+	 * And it is even smaller this way, making it unconditional for now:
+	 */
+	if (1) { /* ENABLE_ASH_BASH_COMPAT */
+		fullname = name;
+		goto try_cur_dir;
+	}
+
 	while ((fullname = padvance(&path, name)) != NULL) {
+ try_cur_dir:
 		if ((stat(fullname, &statb) == 0) && S_ISREG(statb.st_mode)) {
 			/*
 			 * Don't bother freeing here, since it will



More information about the busybox-cvs mailing list