* source.c (find_and_open_source): Consistently pass resulting
authorDoug Evans <dje@google.com>
Wed, 11 Apr 2012 18:37:14 +0000 (18:37 +0000)
committerDoug Evans <dje@google.com>
Wed, 11 Apr 2012 18:37:14 +0000 (18:37 +0000)
full path through xfullpath.

gdb/ChangeLog
gdb/source.c

index aceef1e8397be6c04fa8c15c38740abfbe855512..c511d0649e0c57692e2c94b08450f7e7e98bf6b1 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-11  Yuanhui Zhang  <asmwarrior@gmail.com>
+
+       * source.c (find_and_open_source): Consistently pass resulting
+       full path through xfullpath.
+
 2012-04-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Provide more specific displaced-stepping memory error message.
index 97f5d46d21935bf0e4d71452def57f0f4969326c..9b464f90e77800c07eda10e6aa80ab53aada138a 100644 (file)
@@ -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;