From veksler at il.ibm.com:
authorAndrew Cagney <cagney@redhat.com>
Thu, 28 Mar 2002 03:43:37 +0000 (03:43 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 28 Mar 2002 03:43:37 +0000 (03:43 +0000)
* utils.c (gdb_realpath): If canonicalize_file_name fails, return
the xstrduped original path.
Fix PR gdb/417.

gdb/ChangeLog
gdb/utils.c

index 5d247e17deed1bdf902af45cfddf29a005167d1b..5bedbdade2e2bbf868a2a2f8aba682d39fe46db6 100644 (file)
@@ -1,3 +1,10 @@
+2002-03-27  Andrew Cagney  <ac131313@redhat.com>
+
+       From veksler at il.ibm.com:
+       * utils.c (gdb_realpath): If canonicalize_file_name fails, return
+       the xstrduped original path.
+       Fix PR gdb/417.
+
 2002-03-27  Michael Snyder  <msnyder@redhat.com>
 
        * breakpoint.c (_initialize_breakpoint): Clean up help string.
index 4a1b577514303e2f5918bfcffa24a7dd9723752d..3323193b79a94192d8b49929bd8d53bd2e794997 100644 (file)
@@ -2551,7 +2551,11 @@ gdb_realpath (const char *filename)
   char *rp = realpath (filename, buf);
   return xstrdup (rp ? rp : filename);
 #elif defined(HAVE_CANONICALIZE_FILE_NAME)
-  return canonicalize_file_name (filename);
+  char *rp = canonicalize_file_name (filename);
+  if (rp == NULL)
+    return xstrdup (filename);
+  else
+    return rp;
 #else
   return xstrdup (filename);
 #endif