2010-09-30 Ali Lakhia <lakhia@alumni.utexas.net>
* fork-child.c (breakup_args): Fix crash if shell forking is disabled at compile time.
This commit is contained in:
parent
a2c09bd0c7
commit
55e3947383
2 changed files with 13 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
2010-09-30 Ali Lakhia <lakhia@alumni.utexas.net>
|
||||
|
||||
* fork-child.c (breakup_args): Fix crash if shell forking is
|
||||
disabled at compile time.
|
||||
|
||||
2010-10-01 Joel Brobecker <brobecker@adacore.com>
|
||||
|
||||
* ada-lang.c (desc_bounds): Add handling of the case where
|
||||
|
|
|
@ -52,7 +52,7 @@ static char *exec_wrapper;
|
|||
static void
|
||||
breakup_args (char *scratch, char **argv)
|
||||
{
|
||||
char *cp = scratch;
|
||||
char *cp = scratch, *tmp;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
@ -68,15 +68,16 @@ breakup_args (char *scratch, char **argv)
|
|||
*argv++ = cp;
|
||||
|
||||
/* Scan for next arg separator. */
|
||||
cp = strchr (cp, ' ');
|
||||
if (cp == NULL)
|
||||
cp = strchr (cp, '\t');
|
||||
if (cp == NULL)
|
||||
cp = strchr (cp, '\n');
|
||||
tmp = strchr (cp, ' ');
|
||||
if (tmp == NULL)
|
||||
tmp = strchr (cp, '\t');
|
||||
if (tmp == NULL)
|
||||
tmp = strchr (cp, '\n');
|
||||
|
||||
/* No separators => end of string => break. */
|
||||
if (cp == NULL)
|
||||
if (tmp == NULL)
|
||||
break;
|
||||
cp = tmp;
|
||||
|
||||
/* Replace the separator with a terminator. */
|
||||
*cp++ = '\0';
|
||||
|
|
Loading…
Reference in a new issue