From 520f6ade4aea34bb0f76138cdf9141edc7486ce5 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 28 Mar 2002 03:43:37 +0000 Subject: [PATCH] From veksler at il.ibm.com: * utils.c (gdb_realpath): If canonicalize_file_name fails, return the xstrduped original path. Fix PR gdb/417. --- gdb/ChangeLog | 7 +++++++ gdb/utils.c | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5d247e17dee..5bedbdade2e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2002-03-27 Andrew Cagney + + 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 * breakpoint.c (_initialize_breakpoint): Clean up help string. diff --git a/gdb/utils.c b/gdb/utils.c index 4a1b5775143..3323193b79a 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