This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/7] PR gdb/15224 "set history filename" to by immediately converted to absolute path
- From: Pedro Alves <palves at redhat dot com>
- To: mbilal <mbilal at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org, jan dot kratochvil at redhat dot com
- Date: Wed, 08 May 2013 18:25:02 +0100
- Subject: Re: [PATCH 1/7] PR gdb/15224 "set history filename" to by immediately converted to absolute path
- References: <51877A32 dot 1030503 at codesourcery dot com> <51877A99 dot 4060503 at codesourcery dot com> <5188AA15 dot 5010904 at codesourcery dot com> <5188F70A dot 1030908 at codesourcery dot com> <518A736C dot 8070009 at redhat dot com>
On 05/08/2013 04:46 PM, Pedro Alves wrote:
>> +static void
>> +set_history_filename (char *args, int from_tty, struct cmd_list_element *c)
>> +{
>> + if (!IS_ABSOLUTE_PATH (*(char **) c->var))
>> + *(char **) c->var = concat (current_directory, "/", *(char **) c->var,
>> + (char *)NULL);
>> +}
In addition to my previous comments, I realized that this will do the
wrong thing with "set history filename ~/foo". Best use tilde_expand
and gdb_realpath.
--
Pedro Alves