aboutsummaryrefslogtreecommitdiff
path: root/lash.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-23 15:28:28 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-23 15:28:28 +0000
commited424dbf1d3d4f0448b9bfdc6b6128d4c90514ee (patch)
tree5b613c1439ae5bb391a398d5f5a0f011d4da9215 /lash.c
parentd8862928c25be9b00f6755cf445773cd1e4cc22a (diff)
downloadbusybox-ed424dbf1d3d4f0448b9bfdc6b6128d4c90514ee.tar.gz
Some patches from Gennady Feldman. Fixed a glob problem such that
'ls *.h Config.h' works. Fixed a silly typo with fg/bg process control. Made cmdedit exit sanely when it cannot read input.
Diffstat (limited to 'lash.c')
-rw-r--r--lash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lash.c b/lash.c
index 243ba8139..892237b08 100644
--- a/lash.c
+++ b/lash.c
@@ -1019,6 +1019,8 @@ static int expand_arguments(char *command)
(tmpcmd = strsep_space(cmd, &ix)) != NULL; cmd += ix, ix=0) {
if (*tmpcmd == '\0')
break;
+ /* we need to trim() the result for glob! */
+ trim(tmpcmd);
retval = glob(tmpcmd, flags, NULL, &expand_result);
free(tmpcmd); /* Free mem allocated by strsep_space */
if (retval == GLOB_NOSPACE) {
@@ -1041,10 +1043,8 @@ static int expand_arguments(char *command)
error_msg(out_of_space);
return FALSE;
}
- if (i>0) {
- strcat(command+total_length, " ");
- total_length+=1;
- }
+ strcat(command+total_length, " ");
+ total_length+=1;
strcat(command+total_length, expand_result.gl_pathv[i]);
total_length+=length;
}
@@ -1803,7 +1803,7 @@ static int busy_loop(FILE * input)
if (!job_list.fg) {
/* move the shell to the foreground */
/* suppress messages when run from /linuxrc mag@sysgo.de */
- if (tcsetpgrp(0, getpid()) && errno != ENOTTY)
+ if (tcsetpgrp(0, getpgrp()) && errno != ENOTTY)
perror_msg("tcsetpgrp");
}
}