* cli/cli-cmds.c (apropos_command): Fix formatting. Don't call
[binutils-gdb.git] / gdb / cli / cli-cmds.c
index ae02031e1146fa6e06e76ef24f1ed5db88c5f93d..e1d8174f6ad5075740369a35fe2d4902f377fe0f 100644 (file)
@@ -1253,28 +1253,20 @@ show_user (char *args, int from_tty)
 void 
 apropos_command (char *searchstr, int from_tty)
 {
-  extern struct cmd_list_element *cmdlist; /* This is the main command
-                                             list.  */
   regex_t pattern;
-  char *pattern_fastmap;
   char errorbuffer[512];
 
-  pattern_fastmap = xcalloc (256, sizeof (char));
   if (searchstr == NULL)
-      error (_("REGEXP string is empty"));
+    error (_("REGEXP string is empty"));
 
-  if (regcomp(&pattern,searchstr,REG_ICASE) == 0)
-    {
-      pattern.fastmap=pattern_fastmap;
-      re_compile_fastmap(&pattern);
-      apropos_cmd (gdb_stdout,cmdlist,&pattern,"");
-    }
+  if (regcomp (&pattern, searchstr, REG_ICASE) == 0)
+    apropos_cmd (gdb_stdout, cmdlist, &pattern, "");
   else
     {
-      regerror(regcomp(&pattern,searchstr,REG_ICASE),NULL,errorbuffer,512);
-      error (_("Error in regular expression:%s"),errorbuffer);
+      regerror (regcomp (&pattern, searchstr, REG_ICASE), NULL,
+               errorbuffer, 512);
+      error (_("Error in regular expression: %s"), errorbuffer);
     }
-  xfree (pattern_fastmap);
 }
 \f
 /* Print a list of files and line numbers which a user may choose from