This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Expand tildes in solib-search-path entries.
- From: Pedro Alves <palves at redhat dot com>
- To: Thiago Jung Bauermann <thiago dot bauermann at linaro dot org>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Thu, 24 May 2012 16:30:54 +0100
- Subject: Re: [patch] Expand tildes in solib-search-path entries.
- References: <1337710624.19373.9.camel@hactar>
On 05/22/2012 07:17 PM, Thiago Jung Bauermann wrote:
> diff --git a/gdb/source.c b/gdb/source.c
> index 27c5b0e..af68ebd 100644
> --- a/gdb/source.c
> +++ b/gdb/source.c
> @@ -771,8 +771,28 @@ openp (const char *path, int opts, const char *string,
> }
> else
> {
> - /* Normal file name in path -- just use it. */
> - strcpy (filename, dir);
> + /* See whether we need to expand the tilde. */
> + if (strchr(dir, '~'))
Seem to me this could be an "else if" above the "else" instead of
nested within the "else". The "Don't search $cdir" bit below
should never apply, even in the rare beyond belief case of the user's
home expanding to literal "$cdir". Okay with that change.
--
Pedro Alves