summaryrefslogtreecommitdiff
path: root/binutils/ieee.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2000-05-26 13:11:57 +0000
committerAlan Modra <amodra@bigpond.net.au>2000-05-26 13:11:57 +0000
commit0ec238fa07cba008eba87c85d917d849fcb4c492 (patch)
tree63de07d189bc1be9db1080c93c385aab223e0ede /binutils/ieee.c
parent20b373ea5e261308d08c71629f0c6ac2b652b0ea (diff)
downloadbinutils-redhat-0ec238fa07cba008eba87c85d917d849fcb4c492.tar.gz
Eli Zaretskii's DOSish file name patches.
Diffstat (limited to 'binutils/ieee.c')
-rw-r--r--binutils/ieee.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/binutils/ieee.c b/binutils/ieee.c
index a3bb93b8d7..27409cc9ae 100644
--- a/binutils/ieee.c
+++ b/binutils/ieee.c
@@ -1,5 +1,5 @@
/* ieee.c -- Read and write IEEE-695 debugging information.
- Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
@@ -30,6 +30,7 @@
#include "libiberty.h"
#include "debug.h"
#include "budbg.h"
+#include "filenames.h"
/* This structure holds an entry on the block stack. */
@@ -4926,6 +4927,7 @@ ieee_start_compilation_unit (p, filename)
{
struct ieee_handle *info = (struct ieee_handle *) p;
const char *modname;
+ const char *backslash;
char *c, *s;
unsigned int nindx;
@@ -4937,16 +4939,20 @@ ieee_start_compilation_unit (p, filename)
info->filename = filename;
modname = strrchr (filename, '/');
+ /* We could have a mixed forward/back slash case. */
+ backslash = strrchr (modname, '\\');
+ if (backslash > modname)
+ modname = backslash;
+
if (modname != NULL)
++modname;
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ else if (filename[0] && filename[1] == ':')
+ modname = filename + 2;
+#endif
else
- {
- modname = strrchr (filename, '\\');
- if (modname != NULL)
- ++modname;
- else
- modname = filename;
- }
+ modname = filename;
+
c = xstrdup (modname);
s = strrchr (c, '.');
if (s != NULL)
@@ -5194,22 +5200,25 @@ ieee_add_bb11 (info, sec, low, high)
}
else
{
- const char *filename, *modname;
+ const char *filename, *modname, *backslash;
char *c, *s;
/* Start the enclosing BB10 block. */
filename = bfd_get_filename (info->abfd);
modname = strrchr (filename, '/');
+ backslash = strrchr (modname, '\\');
+ if (backslash > modname)
+ modname = backslash;
+
if (modname != NULL)
++modname;
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ else if (filename[0] && filename[1] == ':')
+ modname = filename + 2;
+#endif
else
- {
- modname = strrchr (filename, '\\');
- if (modname != NULL)
- ++modname;
- else
- modname = filename;
- }
+ modname = filename;
+
c = xstrdup (modname);
s = strrchr (c, '.');
if (s != NULL)