From: Doug Evans Date: Wed, 11 Apr 2012 18:37:14 +0000 (+0000) Subject: * source.c (find_and_open_source): Consistently pass resulting X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bc3aa6c30087ecab7a06ec986344d2954e7c847c;p=binutils-gdb.git * source.c (find_and_open_source): Consistently pass resulting full path through xfullpath. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index aceef1e8397..c511d0649e0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-04-11 Yuanhui Zhang + + * source.c (find_and_open_source): Consistently pass resulting + full path through xfullpath. + 2012-04-11 Jan Kratochvil Provide more specific displaced-stepping memory error message. diff --git a/gdb/source.c b/gdb/source.c index 97f5d46d219..9b464f90e77 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -997,7 +997,16 @@ find_and_open_source (const char *filename, result = open (*fullname, OPEN_MODE); if (result >= 0) - return result; + { + /* Call xfullpath here to be consistent with openp + which we use below. */ + char *lpath = xfullpath (*fullname); + + xfree (*fullname); + *fullname = lpath; + return result; + } + /* Didn't work -- free old one, try again. */ xfree (*fullname); *fullname = NULL;