This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Don't core dump from canonicalize_file_name
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 27 Mar 2002 22:35:39 -0500
- Subject: [patch] Don't core dump from canonicalize_file_name
FYI,
I've checked the attached (submitted patch) into trunk and branch. I
suspect I'll need to pull in some other stuff as well ..
Andrew
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.
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.70
diff -u -r1.70 utils.c
--- utils.c 2002/03/19 02:51:07 1.70
+++ utils.c 2002/03/28 02:45:47
@@ -2551,7 +2551,11 @@
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