aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-03-14 19:33:45 +0000
committerEric Andersen <andersen@codepoet.org>2001-03-14 19:33:45 +0000
commit1ef92685cf52b03935e0c235df1f97845710b587 (patch)
tree9fe0194506ccc2a4ce30d72b82746424777e0bfb
parentce4a586edb6abd90c1036666159f831bd2a58895 (diff)
downloadbusybox-w32-1ef92685cf52b03935e0c235df1f97845710b587.tar.gz
busybox-w32-1ef92685cf52b03935e0c235df1f97845710b587.tar.bz2
busybox-w32-1ef92685cf52b03935e0c235df1f97845710b587.zip
Yesterday I make strsep_space include post-token whitespace,
so we should not be adding another " " between tokens. -Erik
-rw-r--r--lash.c3
-rw-r--r--sh.c3
-rw-r--r--shell/lash.c3
3 files changed, 3 insertions, 6 deletions
diff --git a/lash.c b/lash.c
index 1977d5fdc..a3003abea 100644
--- a/lash.c
+++ b/lash.c
@@ -1049,13 +1049,12 @@ static int expand_arguments(char *command)
1049 /* Convert from char** (one word per string) to a simple char*, 1049 /* Convert from char** (one word per string) to a simple char*,
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])+1; 1052 length=strlen(expand_result.gl_pathv[i]);
1053 if (BUFSIZ-total_length-length <= 0) { 1053 if (BUFSIZ-total_length-length <= 0) {
1054 error_msg(out_of_space); 1054 error_msg(out_of_space);
1055 return FALSE; 1055 return FALSE;
1056 } 1056 }
1057 strcat(command+total_length, expand_result.gl_pathv[i]); 1057 strcat(command+total_length, expand_result.gl_pathv[i]);
1058 strcat(command+total_length, " ");
1059 total_length+=length; 1058 total_length+=length;
1060 } 1059 }
1061 globfree (&expand_result); 1060 globfree (&expand_result);
diff --git a/sh.c b/sh.c
index 1977d5fdc..a3003abea 100644
--- a/sh.c
+++ b/sh.c
@@ -1049,13 +1049,12 @@ static int expand_arguments(char *command)
1049 /* Convert from char** (one word per string) to a simple char*, 1049 /* Convert from char** (one word per string) to a simple char*,
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])+1; 1052 length=strlen(expand_result.gl_pathv[i]);
1053 if (BUFSIZ-total_length-length <= 0) { 1053 if (BUFSIZ-total_length-length <= 0) {
1054 error_msg(out_of_space); 1054 error_msg(out_of_space);
1055 return FALSE; 1055 return FALSE;
1056 } 1056 }
1057 strcat(command+total_length, expand_result.gl_pathv[i]); 1057 strcat(command+total_length, expand_result.gl_pathv[i]);
1058 strcat(command+total_length, " ");
1059 total_length+=length; 1058 total_length+=length;
1060 } 1059 }
1061 globfree (&expand_result); 1060 globfree (&expand_result);
diff --git a/shell/lash.c b/shell/lash.c
index 1977d5fdc..a3003abea 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -1049,13 +1049,12 @@ static int expand_arguments(char *command)
1049 /* Convert from char** (one word per string) to a simple char*, 1049 /* Convert from char** (one word per string) to a simple char*,
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])+1; 1052 length=strlen(expand_result.gl_pathv[i]);
1053 if (BUFSIZ-total_length-length <= 0) { 1053 if (BUFSIZ-total_length-length <= 0) {
1054 error_msg(out_of_space); 1054 error_msg(out_of_space);
1055 return FALSE; 1055 return FALSE;
1056 } 1056 }
1057 strcat(command+total_length, expand_result.gl_pathv[i]); 1057 strcat(command+total_length, expand_result.gl_pathv[i]);
1058 strcat(command+total_length, " ");
1059 total_length+=length; 1058 total_length+=length;
1060 } 1059 }
1061 globfree (&expand_result); 1060 globfree (&expand_result);