2010-09-30 Ali Lakhia <lakhia@alumni.utexas.net>
authorMichael Snyder <msnyder@vmware.com>
Fri, 1 Oct 2010 17:35:30 +0000 (17:35 +0000)
committerMichael Snyder <msnyder@vmware.com>
Fri, 1 Oct 2010 17:35:30 +0000 (17:35 +0000)
* fork-child.c (breakup_args): Fix crash if shell forking is
disabled at compile time.

gdb/ChangeLog
gdb/fork-child.c

index fafee4b76f14eefc197a6ada194841eee83db591..081b642a609e5fc897d0bd214e90336a5474bf1e 100644 (file)
@@ -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
index 7b81e8f788be7e2497478f505ea485d64e232bff..96885dab7d346ebe903da27913ef3c67c172c6bb 100644 (file)
@@ -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';
This page took 0.029253 seconds and 4 git commands to generate.