* 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.
This commit is contained in:
Per Bothner
1992-08-05 18:46:00 +00:00
parent 15ee4caab2
commit ee9d275b29
2 changed files with 49 additions and 0 deletions

View File

@ -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).

View File

@ -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] == '-') {