aboutsummaryrefslogtreecommitdiff
path: root/sh.c
diff options
context:
space:
mode:
Diffstat (limited to 'sh.c')
-rw-r--r--sh.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sh.c b/sh.c
index 243ba8139..892237b08 100644
--- a/sh.c
+++ b/sh.c
@@ -1019,6 +1019,8 @@ static int expand_arguments(char *command)
1019 (tmpcmd = strsep_space(cmd, &ix)) != NULL; cmd += ix, ix=0) { 1019 (tmpcmd = strsep_space(cmd, &ix)) != NULL; cmd += ix, ix=0) {
1020 if (*tmpcmd == '\0') 1020 if (*tmpcmd == '\0')
1021 break; 1021 break;
1022 /* we need to trim() the result for glob! */
1023 trim(tmpcmd);
1022 retval = glob(tmpcmd, flags, NULL, &expand_result); 1024 retval = glob(tmpcmd, flags, NULL, &expand_result);
1023 free(tmpcmd); /* Free mem allocated by strsep_space */ 1025 free(tmpcmd); /* Free mem allocated by strsep_space */
1024 if (retval == GLOB_NOSPACE) { 1026 if (retval == GLOB_NOSPACE) {
@@ -1041,10 +1043,8 @@ static int expand_arguments(char *command)
1041 error_msg(out_of_space); 1043 error_msg(out_of_space);
1042 return FALSE; 1044 return FALSE;
1043 } 1045 }
1044 if (i>0) { 1046 strcat(command+total_length, " ");
1045 strcat(command+total_length, " "); 1047 total_length+=1;
1046 total_length+=1;
1047 }
1048 strcat(command+total_length, expand_result.gl_pathv[i]); 1048 strcat(command+total_length, expand_result.gl_pathv[i]);
1049 total_length+=length; 1049 total_length+=length;
1050 } 1050 }
@@ -1803,7 +1803,7 @@ static int busy_loop(FILE * input)
1803 if (!job_list.fg) { 1803 if (!job_list.fg) {
1804 /* move the shell to the foreground */ 1804 /* move the shell to the foreground */
1805 /* suppress messages when run from /linuxrc mag@sysgo.de */ 1805 /* suppress messages when run from /linuxrc mag@sysgo.de */
1806 if (tcsetpgrp(0, getpid()) && errno != ENOTTY) 1806 if (tcsetpgrp(0, getpgrp()) && errno != ENOTTY)
1807 perror_msg("tcsetpgrp"); 1807 perror_msg("tcsetpgrp");
1808 } 1808 }
1809 } 1809 }