From e6d9b9c2fac5d91fbbda8be10775d6903b9c360a Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Wed, 14 Apr 2010 21:22:29 +0000 Subject: [PATCH] * source.c (open): Strip DOS drive letter if present before concatenating string to search path. --- gdb/ChangeLog | 5 +++++ gdb/source.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7749adfd4aa..a3f6f109ec5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-04-14 Doug Evans + + * source.c (open): Strip DOS drive letter if present before + concatenating string to search path. + 2010-04-14 Pedro Alves * objfiles.h (gdb_bfd_close_or_warn): Declare. diff --git a/gdb/source.c b/gdb/source.c index e9893ba566b..47caa1487e4 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -724,6 +724,10 @@ openp (const char *path, int opts, const char *string, goto done; } + /* For dos paths, d:/foo -> /foo, and d:foo -> foo. */ + if (HAS_DRIVE_SPEC (string)) + string = STRIP_DRIVE_SPEC (string); + /* /foo => foo, to avoid multiple slashes that Emacs doesn't like. */ while (IS_DIR_SEPARATOR(string[0])) string++; -- 2.30.2