* main.c (complete_command): Deal with it if arg is NULL.
authorJim Kingdon <jkingdon@engr.sgi.com>
Fri, 25 Mar 1994 16:39:05 +0000 (16:39 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Fri, 25 Mar 1994 16:39:05 +0000 (16:39 +0000)
gdb/ChangeLog
gdb/main.c

index 3bd9f03bc78f58f0778fd0e0f7e4c1c7155dbc30..d2ddcaffc28b035c7c471ed571ced8f8f550bfbe 100644 (file)
@@ -1,3 +1,7 @@
+Fri Mar 25 08:33:28 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
+
+       * main.c (complete_command): Deal with it if arg is NULL.
+
 Thu Mar 24 07:12:09 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
        * config/mips/tm-mips.h (SETUP_ARBITRARY_FRAME): Revise comment
index 96b6cdeb93541e825c07b3fe0cb26ab7f63805fb..38771daed2b5f0a3da100007a8e3539ddcd74bea 100644 (file)
@@ -1987,8 +1987,16 @@ complete_command (arg, from_tty)
 
   dont_repeat ();
 
-  strcpy (rl_line_buffer, arg);
-  rl_point = strlen (arg);
+  if (arg == NULL)
+    {
+      rl_line_buffer[0] = '\0';
+      rl_point = 0;
+    }
+  else
+    {
+      strcpy (rl_line_buffer, arg);
+      rl_point = strlen (arg);
+    }
 
   for (completion = symbol_completion_function (rl_line_buffer, i = 0);
        completion;