[BusyBox] Re: Some more busybox issues...

Larry Doolittle ldoolitt at recycle.lbl.gov
Thu Mar 15 22:50:25 UTC 2001


Andreas pointed out:
> - lash shell expansion is broken:
> /bin # ls m*
> ls: mkdirmknodmoremountmv: No such file or directory

This ought to work.  Quick, Erik, release 0.50, and then
replace sh.c with hush before anyone can find any more bugs
with lash!    0.5 :-) 

      - Larry

--- /home/ldoolitt/cvs/busybox/sh.c	Thu Mar 15 12:25:07 2001
+++ sh.c	Thu Mar 15 14:45:52 2001
@@ -1050,9 +1050,13 @@
 			 * but don't overflow command which is BUFSIZ in length */
 				for (i=0; i < expand_result.gl_pathc; i++) {
 					length=strlen(expand_result.gl_pathv[i]);
-					if (BUFSIZ-total_length-length <= 0) {
+					if (total_length+length+1 >= BUFSIZ) {
 						error_msg(out_of_space);
 						return FALSE;
+					}
+					if (i>0) {
+						strcat(command+total_length, " ");
+						total_length+=1;
 					}
 					strcat(command+total_length, expand_result.gl_pathv[i]);
 					total_length+=length;





More information about the busybox mailing list