summaryrefslogtreecommitdiff
path: root/binutils/arsup.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/arsup.c
parent20b373ea5e261308d08c71629f0c6ac2b652b0ea (diff)
downloadbinutils-redhat-0ec238fa07cba008eba87c85d917d849fcb4c492.tar.gz
Eli Zaretskii's DOSish file name patches.
Diffstat (limited to 'binutils/arsup.c')
-rw-r--r--binutils/arsup.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/binutils/arsup.c b/binutils/arsup.c
index d6809fc474..eebee99771 100644
--- a/binutils/arsup.c
+++ b/binutils/arsup.c
@@ -1,5 +1,5 @@
/* arsup.c - Archive support for MRI compatibility
- Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+ Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -31,6 +31,7 @@ style librarian command syntax + 1 word LIST
#include "arsup.h"
#include "libiberty.h"
#include "bucomm.h"
+#include "filenames.h"
static void map_over_list
PARAMS ((bfd *, void (*function) (bfd *, bfd *), struct list *));
@@ -76,7 +77,7 @@ map_over_list (arch, function, list)
for (head = arch->next; head; head = head->next)
{
if (head->filename != NULL
- && strcmp (ptr->name, head->filename) == 0)
+ && FILENAME_CMP (ptr->name, head->filename) == 0)
{
found = true;
function (head, prev);
@@ -160,7 +161,9 @@ DEFUN(ar_open,(name, t),
{
char *tname = (char *) xmalloc (strlen (name) + 10);
real_name = name;
- sprintf(tname, "%s-tmp", name);
+ /* Prepend tmp- to the beginning, to avoid file-name clashes after
+ truncation on filesystems with limited namespaces (DOS). */
+ sprintf(tname, "tmp-%s", name);
obfd = bfd_openw(tname, NULL);
if (!obfd) {
@@ -289,7 +292,7 @@ DEFUN(ar_delete, (list),
bfd **prev = &(obfd->archive_head);
int found = 0;
while (member) {
- if (strcmp(member->filename, list->name) == 0) {
+ if (FILENAME_CMP(member->filename, list->name) == 0) {
*prev = member->next;
found = 1;
}
@@ -346,7 +349,7 @@ DEFUN(ar_replace, (list),
int found = 0;
while (member)
{
- if (strcmp(member->filename, list->name) == 0)
+ if (FILENAME_CMP(member->filename, list->name) == 0)
{
/* Found the one to replace */
bfd *abfd = bfd_openr(list->name, 0);
@@ -437,7 +440,7 @@ DEFUN(ar_extract,(list),
int found = 0;
while (member && !found)
{
- if (strcmp(member->filename, list->name) == 0)
+ if (FILENAME_CMP(member->filename, list->name) == 0)
{
extract_file(member);
found = 1;