* cli/cli-cmds.c (apropos_command): Fix formatting. Don't call

re_compile_fastmap.
This commit is contained in:
Tom Tromey 2011-01-17 16:20:56 +00:00
parent a5a44b5381
commit f55af66d6e
2 changed files with 11 additions and 14 deletions

View File

@ -1,3 +1,8 @@
2011-01-17 Tom Tromey <tromey@redhat.com>
* cli/cli-cmds.c (apropos_command): Fix formatting. Don't call
re_compile_fastmap.
2011-01-17 Pierre Muller <muller@ics.u-strasbg.fr> 2011-01-17 Pierre Muller <muller@ics.u-strasbg.fr>
* p-exp.y (intvar): New static variable, used to set CURRENT_TYPE * p-exp.y (intvar): New static variable, used to set CURRENT_TYPE

View File

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