Fix problems introduced with my last change.
[deliverable/binutils-gdb.git] / gdb / maint.c
index 7003c022ddaa23deeb315581f7db7dd355b6aafc..86e269a5a1e96fbfe5ed27bb478bd3828b41ffc8 100644 (file)
@@ -57,6 +57,8 @@ static void maintenance_info_sections PARAMS ((char *, int));
 
 static void maintenance_print_command PARAMS ((char *, int));
 
+static void maintenance_do_deprecate (char *, int);
+
 /* Set this to the maximum number of seconds to wait instead of waiting forever
    in target_wait().  If this timer times out, then it generates an error and
    the command is aborted.  This replaces most of the need for timeouts in the
@@ -411,6 +413,8 @@ maintenance_do_deprecate (char *text, int deprecate)
   int len;
   char *replacement = NULL;
 
+  if (text == NULL)
+    return;
 
   if (!lookup_cmd_composition (text, &alias, &prefix_cmd, &cmd))
     {
@@ -421,10 +425,12 @@ maintenance_do_deprecate (char *text, int deprecate)
   if (deprecate)
     {
       /* look for a replacement command */
-      if (start_ptr = strchr (text, '\"'))
+      start_ptr = strchr (text, '\"');
+      if (start_ptr != NULL)
        {
          start_ptr++;
-         if (end_ptr = strrchr (start_ptr, '\"'))
+         end_ptr = strrchr (start_ptr, '\"');
+         if (end_ptr != NULL)
            {
              len = end_ptr - start_ptr;
              start_ptr[len] = '\0';
@@ -489,6 +495,7 @@ to test internal functions such as the C++ demangler, etc.",
      "Commands for showing internal info about the program being debugged.",
                  &maintenanceinfolist, "maintenance info ", 0,
                  &maintenancelist);
+  add_alias_cmd ("i", "info", class_maintenance, 1, &maintenancelist);
 
   add_cmd ("sections", class_maintenance, maintenance_info_sections,
           "List the BFD sections of the exec and core files.",
This page took 0.023169 seconds and 4 git commands to generate.