[BusyBox] Fw: busybox patch
Kenneth Rawlings
rawlink at traxess.com
Tue Jun 18 13:14:03 UTC 2002
Sorry, I now realize I should have sent this message to this address rather
than the codepoet address. Sorry.
Kenneth
----- Original Message -----
From: "Kenneth Rawlings" <rawlink at traxess.com>
To: <andersen at codepoet.org>
Sent: Tuesday, June 18, 2002 1:01 PM
Subject: Fw: busybox patch
We are planning on using busybox for a project here at my work and we
noticed a bug in how the '.' command is being processed by ash. It
correctly skips over relative or absolute paths except in the case where the
file to be included is in the current directory. The following patch should
fix ash to behave a little more like bash (of course, if you don't want it
to behave that way, you can just ignore me :-)).
Thanks for a great piece of code,
Kenneth Rawlings
Software Engineer
Traxess Inc.
----------Start Patch--------------
diff -urN busybox-0.60.3/ash.c busybox-0.60.3-kenpatch/ash.c
--- busybox-0.60.3/ash.c Fri Apr 26 22:12:54 2002
+++ busybox-0.60.3-kenpatch/ash.c Mon Jun 17 12:57:29 2002
@@ -7831,6 +7831,11 @@
if (strchr(mybasename, '/'))
return mybasename;
+ if ((stat(mybasename, &statb) == 0) && S_ISREG(statb.st_mode)) {
+ // it exists in the current directory
+ return mybasename;
+ }
+
while ((fullname = padvance(&path, mybasename)) != NULL) {
if ((stat(fullname, &statb) == 0) && S_ISREG(statb.st_mode)) {
/*
---------End Patch----------------
More information about the busybox
mailing list