diff options
author | Eric Andersen | 2001-03-15 23:01:19 +0000 |
---|---|---|
committer | Eric Andersen | 2001-03-15 23:01:19 +0000 |
commit | 4aaefc2a50600f2b2247ec2d607c19896e9cc0df (patch) | |
tree | 84b7e2cbe1e3622ea39b6fb6a9a340f5f6c4524f /sh.c | |
parent | c5b3242d3d0510eaab6dca4a123f222677a1076f (diff) | |
download | busybox-4aaefc2a50600f2b2247ec2d607c19896e9cc0df.zip busybox-4aaefc2a50600f2b2247ec2d607c19896e9cc0df.tar.gz |
Fix from Larry for glob problems.
-Erik
Diffstat (limited to 'sh.c')
-rw-r--r-- | sh.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1050,10 +1050,14 @@ static int expand_arguments(char *command) * 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; } |