aboutsummaryrefslogtreecommitdiff
path: root/binutils/ar.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2010-01-13 11:15:52 +0000
committerTristan Gingold <gingold@adacore.com>2010-01-13 11:15:52 +0000
commitfd3a68167e6b986751558ca54fa46f4a18fb5228 (patch)
treed2fbb5e8f53d720b9a0a09894c5c009342f4f1c1 /binutils/ar.c
parent16c06870bc4536f0ff076cb1e7d2eadac15aec85 (diff)
downloadgdb-fd3a68167e6b986751558ca54fa46f4a18fb5228.zip
gdb-fd3a68167e6b986751558ca54fa46f4a18fb5228.tar.gz
gdb-fd3a68167e6b986751558ca54fa46f4a18fb5228.tar.bz2
2010-01-13 Tristan Gingold <gingold@adacore.com>
* ar.c (main): Use lbasename. (normalize): Ditto. * objdump.c (update_source_path): Ditto.
Diffstat (limited to 'binutils/ar.c')
-rw-r--r--binutils/ar.c35
1 files changed, 2 insertions, 33 deletions
diff --git a/binutils/ar.c b/binutils/ar.c
index 6cdd119..fd1b9ec 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -303,22 +303,7 @@ normalize (const char *file, bfd *abfd)
if (full_pathname)
return file;
- 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 (filename == NULL || (bslash != NULL && bslash > filename))
- filename = bslash;
- if (filename == NULL && file[0] != '\0' && file[1] == ':')
- filename = file + 1;
- }
-#endif
- if (filename != (char *) NULL)
- filename++;
- else
- filename = file;
+ filename = lbasename (file);
if (ar_truncate
&& abfd != NULL
@@ -397,24 +382,8 @@ main (int argc, char **argv)
if (is_ranlib < 0)
{
- char *temp;
-
- temp = strrchr (program_name, '/');
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- {
- /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
- char *bslash = strrchr (program_name, '\\');
+ const char *temp = lbasename (program_name);
- if (temp == NULL || (bslash != NULL && bslash > temp))
- temp = bslash;
- if (temp == NULL && program_name[0] != '\0' && program_name[1] == ':')
- temp = program_name + 1;
- }
-#endif
- if (temp == NULL)
- temp = program_name;
- else
- ++temp;
if (strlen (temp) >= 6
&& FILENAME_CMP (temp + strlen (temp) - 6, "ranlib") == 0)
is_ranlib = 1;