OSDN Git Service

* cp-support.c (first_component_command): Return if no arguments.
authoraristovski <aristovski>
Fri, 28 Mar 2008 19:52:23 +0000 (19:52 +0000)
committeraristovski <aristovski>
Fri, 28 Mar 2008 19:52:23 +0000 (19:52 +0000)
gdb/ChangeLog
gdb/cp-support.c

index d36d4ce..75b9d93 100644 (file)
@@ -1,3 +1,7 @@
+2008-03-19  Aleksandar Ristovski <aristovski@qnx.com>
+
+       * cp-support.c (first_component_command): Return if no arguments.
+
 2008-03-28  Carlos O'Donell  <carlos@codesourcery.com>
 
        * ser-mingw.c (ser_windows_open): Open requested name.
index 5c610cc..696888e 100644 (file)
@@ -892,8 +892,14 @@ maint_cplus_command (char *arg, int from_tty)
 static void
 first_component_command (char *arg, int from_tty)
 {
-  int len = cp_find_first_component (arg);
-  char *prefix = alloca (len + 1);
+  int len;  
+  char *prefix; 
+
+  if (!arg)
+    return;
+
+  len = cp_find_first_component (arg);
+  prefix = alloca (len + 1);
 
   memcpy (prefix, arg, len);
   prefix[len] = '\0';