diff options
author | Tom Tromey <tom@tromey.com> | 2021-12-07 21:51:03 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-12-07 21:54:18 -0700 |
commit | a8a7c763fdc5057684234feef94796ef9886aba8 (patch) | |
tree | 778e215f61874b2a4e486f603209b3f99426bbd9 /gdb/source.c | |
parent | 28a0d291cd726f5945f54412143377fde3842bcb (diff) | |
download | gdb-a8a7c763fdc5057684234feef94796ef9886aba8.zip gdb-a8a7c763fdc5057684234feef94796ef9886aba8.tar.gz gdb-a8a7c763fdc5057684234feef94796ef9886aba8.tar.bz2 |
Fix bug in source.c change
My earlier change to source.c ("Remove an xfree from add_path")
introduced a regression. This patch fixes the problem.
Diffstat (limited to 'gdb/source.c')
-rw-r--r-- | gdb/source.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/source.c b/gdb/source.c index d91389e..f28c306 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -660,8 +660,8 @@ add_path (const char *dirname, char **which_path, int parse_separators) more. */ if (prefix) { - std::string temp (old, prefix); - *which_path = concat (temp.c_str (), tinybuf, name, &old[prefix], + std::string temp = std::string (old, prefix) + tinybuf + name; + *which_path = concat (temp.c_str (), &old[prefix], (char *) nullptr); prefix = temp.length (); } |