aboutsummaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2000-05-26 13:11:57 +0000
committerAlan Modra <amodra@gmail.com>2000-05-26 13:11:57 +0000
commit5af11cab92a8d4ed9b0cd7a46f05cf02a8ba901e (patch)
tree43c01869523de4ad682493e6674e5e8a9fed1804 /binutils/objcopy.c
parent010c70e10fb422ae6151a8808215a122f461fce8 (diff)
downloadgdb-5af11cab92a8d4ed9b0cd7a46f05cf02a8ba901e.zip
gdb-5af11cab92a8d4ed9b0cd7a46f05cf02a8ba901e.tar.gz
gdb-5af11cab92a8d4ed9b0cd7a46f05cf02a8ba901e.tar.bz2
Eli Zaretskii's DOSish file name patches.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 36d5f4c..b8a49c8 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -1,5 +1,5 @@
/* objcopy.c -- copy object file from input to output, optionally massaging it.
- Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 1999
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -25,6 +25,7 @@
#include "getopt.h"
#include "libiberty.h"
#include "budbg.h"
+#include "filenames.h"
#include <sys/stat.h>
/* A list of symbols to explicitly strip out, or to keep. A linked
@@ -2253,7 +2254,15 @@ main (argc, argv)
if (is_strip < 0)
{
int i = strlen (program_name);
- is_strip = (i >= 5 && strcmp (program_name + i - 5, "strip") == 0);
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ /* Drop the .exe suffix, if any. */
+ if (i > 4 && FILENAME_CMP (program_name + i - 4, ".exe") == 0)
+ {
+ i -= 4;
+ program_name[i] = '\0';
+ }
+#endif
+ is_strip = (i >= 5 && FILENAME_CMP (program_name + i - 5, "strip") == 0);
}
if (is_strip)