diff options
author | David Henkel-Wallace <gumby@cygnus> | 1991-04-19 18:04:37 +0000 |
---|---|---|
committer | David Henkel-Wallace <gumby@cygnus> | 1991-04-19 18:04:37 +0000 |
commit | 931004e4578333db0429abc7219282dbc0e10076 (patch) | |
tree | 2f3c3e2ac578b88e4d62581b1a3dc634c857271a /binutils/ar.c | |
parent | ab01cf22f0214263af5fb28c5d6612efe6cfbffb (diff) | |
download | gdb-931004e4578333db0429abc7219282dbc0e10076.zip gdb-931004e4578333db0429abc7219282dbc0e10076.tar.gz gdb-931004e4578333db0429abc7219282dbc0e10076.tar.bz2 |
allow the user to specify a file more than once on the command line --
the duplicate references are ignored.
::wq
Diffstat (limited to 'binutils/ar.c')
-rw-r--r-- | binutils/ar.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/binutils/ar.c b/binutils/ar.c index 0ba83ca..c547874 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -511,7 +511,6 @@ extract_file(abfd) exit(1); } } - /* no need to byte-swap; the two formats are presumably compatible(!) */ fwrite(cbuf, 1, nread, ostream); ncopied += tocopy; } @@ -845,6 +844,14 @@ replace_members(files_to_move) if (newer_only) { struct stat fsbuf, asbuf; + + if (current->arelt_data == NULL) { + /* This can only happen if you specify a file on the + command line more than once. */ + fprintf (stderr, "Duplicate file specified: %s -- skipping.\n", *files_to_move); + goto next_file; + } + if (stat(*files_to_move, &fsbuf) != 0) { if (errno != ENOENT) bfd_fatal(*files_to_move); |