aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-03-28 03:43:37 +0000
committerAndrew Cagney <cagney@redhat.com>2002-03-28 03:43:37 +0000
commit520f6ade4aea34bb0f76138cdf9141edc7486ce5 (patch)
tree3d81de898363ffb07662251701f2d269b27b03e0 /gdb/utils.c
parente92d460e59b5271ec44858eecd5b0957eb75ea12 (diff)
downloadgdb-520f6ade4aea34bb0f76138cdf9141edc7486ce5.zip
gdb-520f6ade4aea34bb0f76138cdf9141edc7486ce5.tar.gz
gdb-520f6ade4aea34bb0f76138cdf9141edc7486ce5.tar.bz2
From veksler at il.ibm.com:
* utils.c (gdb_realpath): If canonicalize_file_name fails, return the xstrduped original path. Fix PR gdb/417.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 4a1b577..3323193 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -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