From: Tom Tromey Date: Wed, 8 Dec 2021 04:51:03 +0000 (-0700) Subject: Fix bug in source.c change X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8a7c763fdc5057684234feef94796ef9886aba8;p=binutils-gdb.git 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. --- diff --git a/gdb/source.c b/gdb/source.c index d91389e28b7..f28c30628e6 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 (); }