aboutsummaryrefslogtreecommitdiff
path: root/sh.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-03-15 23:01:19 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-03-15 23:01:19 +0000
commitecf3e07bc4dd17548ad5a2f2c0d6e93fe73ce747 (patch)
tree84b7e2cbe1e3622ea39b6fb6a9a340f5f6c4524f /sh.c
parent6f74341737b567b4f98112b766a2fbdeb356c97d (diff)
downloadbusybox-w32-ecf3e07bc4dd17548ad5a2f2c0d6e93fe73ce747.tar.gz
busybox-w32-ecf3e07bc4dd17548ad5a2f2c0d6e93fe73ce747.tar.bz2
busybox-w32-ecf3e07bc4dd17548ad5a2f2c0d6e93fe73ce747.zip
Fix from Larry for glob problems.
-Erik git-svn-id: svn://busybox.net/trunk/busybox@2114 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'sh.c')
-rw-r--r--sh.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sh.c b/sh.c
index a3003abea..6fedfe8dd 100644
--- a/sh.c
+++ b/sh.c
@@ -1050,10 +1050,14 @@ static int expand_arguments(char *command)
1050 * but don't overflow command which is BUFSIZ in length */ 1050 * but don't overflow command which is BUFSIZ in length */
1051 for (i=0; i < expand_result.gl_pathc; i++) { 1051 for (i=0; i < expand_result.gl_pathc; i++) {
1052 length=strlen(expand_result.gl_pathv[i]); 1052 length=strlen(expand_result.gl_pathv[i]);
1053 if (BUFSIZ-total_length-length <= 0) { 1053 if (total_length+length+1 >= BUFSIZ) {
1054 error_msg(out_of_space); 1054 error_msg(out_of_space);
1055 return FALSE; 1055 return FALSE;
1056 } 1056 }
1057 if (i>0) {
1058 strcat(command+total_length, " ");
1059 total_length+=1;
1060 }
1057 strcat(command+total_length, expand_result.gl_pathv[i]); 1061 strcat(command+total_length, expand_result.gl_pathv[i]);
1058 total_length+=length; 1062 total_length+=length;
1059 } 1063 }