diff options
author | obrien <obrien@FreeBSD.org> | 2000-06-20 06:20:42 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2000-06-20 06:20:42 +0000 |
commit | 813b11648e223be167ed3d9c1b234eb99ab9006e (patch) | |
tree | 3f2e79c5a66aac2f8eb0a069744251ab05fcc87d /contrib/binutils/bfd/archive.c | |
parent | 4e16f4e9862f75bc9baf95241e1ed357017bfdb9 (diff) | |
download | FreeBSD-src-813b11648e223be167ed3d9c1b234eb99ab9006e.zip FreeBSD-src-813b11648e223be167ed3d9c1b234eb99ab9006e.tar.gz |
Import a virgin (but trimed) Binutils 2.10 release.
Diffstat (limited to 'contrib/binutils/bfd/archive.c')
-rw-r--r-- | contrib/binutils/bfd/archive.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/contrib/binutils/bfd/archive.c b/contrib/binutils/bfd/archive.c index 19293af..27dfd39 100644 --- a/contrib/binutils/bfd/archive.c +++ b/contrib/binutils/bfd/archive.c @@ -1,5 +1,5 @@ /* BFD back-end for archive files (libraries). - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. @@ -1183,6 +1183,17 @@ normalize (abfd, file) { const char *filename = strrchr (file, '/'); + +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + { + /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ + char *bslash = strrchr (file, '\\'); + if (bslash > filename) + filename = bslash; + if (filename == NULL && file[0] != '\0' && file[1] == ':') + filename = file + 1; + } +#endif if (filename != (char *) NULL) filename++; else @@ -1515,6 +1526,17 @@ bfd_bsd_truncate_arname (abfd, pathname, arhdr) CONST char *filename = strrchr (pathname, '/'); int maxlen = ar_maxnamelen (abfd); +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + { + /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ + char *bslash = strrchr (pathname, '\\'); + if (bslash > filename) + filename = bslash; + if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':') + filename = pathname + 1; + } +#endif + if (filename == NULL) filename = pathname; else @@ -1555,6 +1577,17 @@ bfd_gnu_truncate_arname (abfd, pathname, arhdr) CONST char *filename = strrchr (pathname, '/'); int maxlen = ar_maxnamelen (abfd); +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + { + /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ + char *bslash = strrchr (pathname, '\\'); + if (bslash > filename) + filename = bslash; + if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':') + filename = pathname + 1; + } +#endif + if (filename == NULL) filename = pathname; else |