[PATCH 1/7] PR gdb/15224 "set history filename" to by immediately converted to absolute path

Pedro Alves palves@redhat.com
Wed May 8 17:25:00 GMT 2013


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



More information about the Gdb-patches mailing list