2010-01-13 Tristan Gingold <gingold@adacore.com>

* ar.c (main): Use lbasename.
	(normalize): Ditto.
	* objdump.c (update_source_path): Ditto.
This commit is contained in:
Tristan Gingold 2010-01-13 11:15:52 +00:00
parent 16c06870bc
commit fd3a68167e
3 changed files with 9 additions and 48 deletions

View File

@ -1,3 +1,9 @@
2010-01-13 Tristan Gingold <gingold@adacore.com>
* ar.c (main): Use lbasename.
(normalize): Ditto.
* objdump.c (update_source_path): Ditto.
2010-01-12 Tristan Gingold <gingold@adacore.com> 2010-01-12 Tristan Gingold <gingold@adacore.com>
* makefile.vms (CFLAGS): Turns warnings into informational messages. * makefile.vms (CFLAGS): Turns warnings into informational messages.

View File

@ -303,22 +303,7 @@ normalize (const char *file, bfd *abfd)
if (full_pathname) if (full_pathname)
return file; return file;
filename = strrchr (file, '/'); filename = lbasename (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;
if (ar_truncate if (ar_truncate
&& abfd != NULL && abfd != NULL
@ -397,24 +382,8 @@ main (int argc, char **argv)
if (is_ranlib < 0) if (is_ranlib < 0)
{ {
char *temp; const char *temp = lbasename (program_name);
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, '\\');
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 if (strlen (temp) >= 6
&& FILENAME_CMP (temp + strlen (temp) - 6, "ranlib") == 0) && FILENAME_CMP (temp + strlen (temp) - 6, "ranlib") == 0)
is_ranlib = 1; is_ranlib = 1;

View File

@ -1156,21 +1156,7 @@ update_source_path (const char *filename)
return NULL; return NULL;
/* Get the name of the file. */ /* Get the name of the file. */
fname = strrchr (filename, '/'); fname = lbasename (filename);
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
{
/* We could have a mixed forward/back slash case. */
char *backslash = strrchr (filename, '\\');
if (fname == NULL || (backslash != NULL && backslash > fname))
fname = backslash;
if (fname == NULL && filename[0] != '\0' && filename[1] == ':')
fname = filename + 1;
}
#endif
if (fname == NULL)
fname = filename;
else
++fname;
/* If file exists under a new path, we need to add it to the list /* If file exists under a new path, we need to add it to the list
so that show_line knows about it. */ so that show_line knows about it. */