C++-ify path substitution code

I found some uses of xfree in the path substitution code in source.c.
C++-ifying struct substitute_path_rule both simplifies the code and
removes manual memory management.

Regression tested on x86-64 Fedora 34.
This commit is contained in:
Tom Tromey
2021-10-25 18:20:24 -06:00
parent 2749ac1339
commit abb6af934c
2 changed files with 52 additions and 119 deletions

View File

@ -128,7 +128,7 @@ extern symtab_and_line set_current_source_symtab_and_line
extern void clear_current_source_symtab_and_line (void);
/* Add a source path substitution rule. */
extern void add_substitute_path_rule (char *, char *);
extern void add_substitute_path_rule (const char *, const char *);
/* Flags passed as 4th argument to print_source_lines. */
enum print_source_lines_flag