mirror of
https://github.com/sheumann/hush.git
synced 2025-01-14 12:30:40 +00:00
When using wordexp, only try to use the expand command
when something actually got expanded. Skip it otherwise. -Erik
This commit is contained in:
parent
78f57460f2
commit
1365bb7861
2
lash.c
2
lash.c
@ -941,6 +941,7 @@ static int expand_arguments(char *command)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (expand_result.we_wordc > 0) {
|
||||
/* Convert from char** (one word per string) to a simple char*,
|
||||
* but don't overflow command which is BUFSIZ in length */
|
||||
*command = '\0';
|
||||
@ -955,6 +956,7 @@ static int expand_arguments(char *command)
|
||||
total_length+=length;
|
||||
}
|
||||
wordfree (&expand_result);
|
||||
}
|
||||
#else
|
||||
|
||||
/* Ok. They don't have a recent glibc and they don't have uClibc. Chances
|
||||
|
2
sh.c
2
sh.c
@ -941,6 +941,7 @@ static int expand_arguments(char *command)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (expand_result.we_wordc > 0) {
|
||||
/* Convert from char** (one word per string) to a simple char*,
|
||||
* but don't overflow command which is BUFSIZ in length */
|
||||
*command = '\0';
|
||||
@ -955,6 +956,7 @@ static int expand_arguments(char *command)
|
||||
total_length+=length;
|
||||
}
|
||||
wordfree (&expand_result);
|
||||
}
|
||||
#else
|
||||
|
||||
/* Ok. They don't have a recent glibc and they don't have uClibc. Chances
|
||||
|
@ -941,6 +941,7 @@ static int expand_arguments(char *command)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (expand_result.we_wordc > 0) {
|
||||
/* Convert from char** (one word per string) to a simple char*,
|
||||
* but don't overflow command which is BUFSIZ in length */
|
||||
*command = '\0';
|
||||
@ -955,6 +956,7 @@ static int expand_arguments(char *command)
|
||||
total_length+=length;
|
||||
}
|
||||
wordfree (&expand_result);
|
||||
}
|
||||
#else
|
||||
|
||||
/* Ok. They don't have a recent glibc and they don't have uClibc. Chances
|
||||
|
Loading…
x
Reference in New Issue
Block a user