From: Per Bothner Date: Wed, 5 Aug 1992 18:46:00 +0000 (+0000) Subject: * copy.c: When is_strip (because it is invoked as the strip X-Git-Tag: gdb-4_18~21362 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee9d275b29f54966d7a52ce410bff7f194cd23c1;p=platform%2Fupstream%2Fbinutils.git * copy.c: When is_strip (because it is invoked as the strip program), follow traditional argv processing: 'strip file1 file2' now strips file1 and file2, rather than stripping file1 (as input), leaving output in file2. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index a603746..b4f9c42 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,18 @@ +Wed Aug 5 11:25:27 1992 Per Bothner (bothner@rtl.cygnus.com) + + * copy.c: When is_strip (because it is invoked as the strip + program), follow traditional argv processing: + 'strip file1 file2' now strips file1 and file2, rather + than stripping file1 (as input), leaving output in file2. + +Mon Jul 27 16:28:08 1992 Per Bothner (bothner@rtl.cygnus.com) + + * objdump.c (display_info, display_info_table): Call + bfd_set_format() on dummy bfd before using it (twice). + * ar.c: Make sure archive is created on command 'r' + even when no elements are inserted. (Clean up and + simplify some non-working related code.) + Mon Jul 20 02:48:38 1992 D. V. Henkel-Wallace (gumby@cygnus.com) * configure.in: hppa support doesn't assume hp OS (from sef). diff --git a/binutils/copy.c b/binutils/copy.c index 12d2f35..fbf6f05 100644 --- a/binutils/copy.c +++ b/binutils/copy.c @@ -51,6 +51,14 @@ usage() exit(1); } +static +void +strip_usage() +{ + fprintf(stderr, "Usage %s [-v] filename ...\n", program_name); + exit(1); +} + /* Create a temp file in the same directory as supplied */ static @@ -394,6 +402,32 @@ main(argc, argv) is_strip = (i >= 5 && strcmp(program_name+i-5,"strip")); } + if (is_strip) + { + for (i = 1; i < argc; i++) + { + if (argv[i][0] != '-') + break; + if (argv[i][1] == '-') { + i++; + break; + } + switch (argv[i][1]) { + case 'v': + verbose = true; + break; + default: + strip_usage(); + } + } + for ( ; i < argc; i++) { + char *tmpname = make_tempname(argv[i]); + copy_file(argv[i], tmpname); + rename(tmpname, argv[i]); + } + return 0; + } + for (i = 1; i < argc; i++) { if (argv[i][0] == '-') {