This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libiberty patch for gdb cross-debugging support
- From: Danny Backx <danny dot backx at scarlet dot be>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 20 Sep 2009 17:51:13 +0200
- Subject: Re: libiberty patch for gdb cross-debugging support
- References: <1253448137.8804.226.camel@pavilion>
- Reply-to: danny dot backx at scarlet dot be
On Sun, 2009-09-20 at 14:02 +0200, Danny Backx wrote:
> When using gdb as a cross-debugger from e.g. a linux development pc to a
> windows ce target (e.g. an embedded system), the source and target can
> have different filesystem naming standards.
>
> This causes gdb to have trouble locating the right file on the host, to
> match the DLL loaded on the target : a path such as
> \network\x86\libgcc_s_sjlj-1.dll
> doesn't get translated into
> /opt/x86mingw32ce/bin/libgcc_s_sjlj-1.dll
> so some of the functionality in gdb doesn't work.
>
> The cause lies in macros in include/filenames.h . I mistakenly believed
> I had to talk to the binutils maintainers about this.
>
> I'm including a proposed patch that has been created with guidance
> from the gdb maintainers and later the binutils list. But obviously this
> is on your territory.
>
> Is this the way to handle this type of change ?
>
> Please comment, I'm prepared to do the extra work necessary to make this
> fit into everyone's standards.
It looks like I did an unfortunate manipulation which caused the diff
file to be overwritten between my inspection and sending it. What was
attached to my previous message was not wrong but incomplete (only the
diff in one directory).
Attached now is the better diff (in include, bfd, libiberty, and gdb
directories). While this is beyond the scope of the libiberty
maintainers, this does give the full picture.
Apologies for that.
Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
Index: bfd/archive.c
===================================================================
RCS file: /cvs/src/src/bfd/archive.c,v
retrieving revision 1.58
diff -u -r1.58 archive.c
--- bfd/archive.c 2 Sep 2009 07:18:35 -0000 1.58
+++ bfd/archive.c 20 Sep 2009 15:42:59 -0000
@@ -1295,7 +1295,7 @@
{
const char *filename = strrchr (file, '/');
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ if (have_dos_based_file_system())
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (file, '\\');
@@ -1304,11 +1304,13 @@
if (filename == NULL && file[0] != '\0' && file[1] == ':')
filename = file + 1;
}
-#endif
- if (filename != NULL)
- filename++;
else
- filename = file;
+ {
+ if (filename != NULL)
+ filename++;
+ else
+ filename = file;
+ }
return filename;
}
#endif
@@ -1820,7 +1822,7 @@
const char *filename = strrchr (pathname, '/');
size_t maxlen = ar_maxnamelen (abfd);
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ if (have_dos_based_file_system())
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (pathname, '\\');
@@ -1829,7 +1831,6 @@
if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':')
filename = pathname + 1;
}
-#endif
if (filename == NULL)
filename = pathname;
@@ -1868,7 +1869,7 @@
const char *filename = strrchr (pathname, '/');
size_t maxlen = ar_maxnamelen (abfd);
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ if (have_dos_based_file_system())
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (pathname, '\\');
@@ -1878,7 +1879,6 @@
if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':')
filename = pathname + 1;
}
-#endif
if (filename == NULL)
filename = pathname;
Index: gdb/completer.c
===================================================================
RCS file: /cvs/src/src/gdb/completer.c,v
retrieving revision 1.34
diff -u -r1.34 completer.c
--- gdb/completer.c 25 Mar 2009 10:50:56 -0000 1.34
+++ gdb/completer.c 20 Sep 2009 15:43:05 -0000
@@ -232,13 +232,12 @@
else
break; /* Hit the end of text. */
}
-#if HAVE_DOS_BASED_FILE_SYSTEM
/* If we have a DOS-style absolute file name at the beginning of
TEXT, and the colon after the drive letter is the only colon
we found, pretend the colon is not there. */
- else if (p < text + 3 && *p == ':' && p == text + 1 + quoted)
+ else if (have_dos_based_file_system()
+ && p < text + 3 && *p == ':' && p == text + 1 + quoted)
;
-#endif
else if (*p == ':' && !colon)
{
colon = p;
Index: gdb/source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.103
diff -u -r1.103 source.c
--- gdb/source.c 23 Jul 2009 23:20:00 -0000 1.103
+++ gdb/source.c 20 Sep 2009 15:43:08 -0000
@@ -474,14 +474,20 @@
/* name is the start of the directory.
p is the separator (or null) following the end. */
- while (!(IS_DIR_SEPARATOR (*name) && p <= name + 1) /* "/" */
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- /* On MS-DOS and MS-Windows, h:\ is different from h: */
- && !(p == name + 3 && name[1] == ':') /* "d:/" */
-#endif
- && IS_DIR_SEPARATOR (p[-1]))
- /* Sigh. "foo/" => "foo" */
- --p;
+ if (have_dos_based_file_system()) {
+ while (!(IS_DIR_SEPARATOR (*name) && p <= name + 1) /* "/" */
+ /* On MS-DOS and MS-Windows, h:\ is different from h: */
+ && !(p == name + 3 && name[1] == ':') /* "d:/" */
+ && IS_DIR_SEPARATOR (p[-1]))
+ /* Sigh. "foo/" => "foo" */
+ --p;
+ } else {
+ while (!(IS_DIR_SEPARATOR (*name) && p <= name + 1) /* "/" */
+ /* On MS-DOS and MS-Windows, h:\ is different from h: */
+ && IS_DIR_SEPARATOR (p[-1]))
+ /* Sigh. "foo/" => "foo" */
+ --p;
+ }
*p = '\0';
while (p > name && p[-1] == '.')
@@ -514,10 +520,9 @@
if (name[0] == '~')
name = tilde_expand (name);
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- else if (IS_ABSOLUTE_PATH (name) && p == name + 2) /* "d:" => "d:." */
+ else if (have_dos_based_file_system()
+ && IS_ABSOLUTE_PATH (name) && p == name + 2) /* "d:" => "d:." */
name = concat (name, ".", (char *)NULL);
-#endif
else if (!IS_ABSOLUTE_PATH (name) && name[0] != '$')
name = concat (current_directory, SLASH_STRING, name, (char *)NULL);
else
Index: gdb/top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.170
diff -u -r1.170 top.c
--- gdb/top.c 31 Aug 2009 20:18:45 -0000 1.170
+++ gdb/top.c 20 Sep 2009 15:43:10 -0000
@@ -52,6 +52,9 @@
#include "readline/readline.h"
#include "readline/history.h"
+/* libiberty include, for have_dos_based_file_system */
+#include "filenames.h"
+
/* readline defines this. */
#undef savestring
@@ -676,6 +679,25 @@
value);
}
+int my_dos_filesys;
+
+static void
+show_dos_based_file_system (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c, const char *value)
+{
+ fprintf_filtered (file, _("\
+Whether the target has a DOS based file system is \"%s\".\n"),
+ value);
+}
+
+static void
+set_dos_based_file_system_command (char *args, int from_tty, struct cmd_list_element *c)
+{
+ fprintf(stderr, "set_dos_based_file_system_command\n");
+ set_dos_based_file_system(my_dos_filesys);
+}
+
+
/* This is like readline(), but it has some gdb-specific behavior.
gdb may want readline in both the synchronous and async modes during
a single gdb invocation. At the ordinary top-level prompt we might
@@ -1630,6 +1652,18 @@
show_history_filename,
&sethistlist, &showhistlist);
+#if 1
+ add_setshow_boolean_cmd ("dos_based_file_system", class_support,
+ &my_dos_filesys, _("\
+Set whether the target has a DOS based file system"), _("\
+Show whether the target has a DOS based file system"), _("\
+whether the target has a DOS based file system"),
+ set_dos_based_file_system_command,
+ show_dos_based_file_system,
+ &setlist, &showlist);
+#endif
+ set_dos_based_file_system(1); /* FIX ME */
+
add_setshow_boolean_cmd ("confirm", class_support, &caution, _("\
Set whether to confirm potentially dangerous operations."), _("\
Show whether to confirm potentially dangerous operations."), NULL,
Index: gdb/utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.219
diff -u -r1.219 utils.c
--- gdb/utils.c 18 Aug 2009 16:17:16 -0000 1.219
+++ gdb/utils.c 20 Sep 2009 15:43:11 -0000
@@ -3280,15 +3280,14 @@
strncpy (dir_name, filename, base_name - filename);
dir_name[base_name - filename] = '\000';
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
/* We need to be careful when filename is of the form 'd:foo', which
is equivalent of d:./foo, which is totally different from d:/foo. */
- if (strlen (dir_name) == 2 && isalpha (dir_name[0]) && dir_name[1] == ':')
+ if (have_dos_based_file_system()
+ && strlen (dir_name) == 2 && isalpha (dir_name[0]) && dir_name[1] == ':')
{
dir_name[2] = '.';
dir_name[3] = '\000';
}
-#endif
/* Canonicalize the directory prefix, and build the resulting
filename. If the dirname realpath already contains an ending
Index: gdb/cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.92
diff -u -r1.92 cli-cmds.c
--- gdb/cli/cli-cmds.c 11 Jul 2009 14:04:23 -0000 1.92
+++ gdb/cli/cli-cmds.c 20 Sep 2009 15:43:11 -0000
@@ -357,24 +357,27 @@
if (chdir (dir) < 0)
perror_with_name (dir);
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
/* There's too much mess with DOSish names like "d:", "d:.",
"d:./foo" etc. Instead of having lots of special #ifdef'ed code,
simply get the canonicalized name of the current directory. */
- dir = getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
-#endif
+ if (have_dos_based_file_system())
+ dir = getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
len = strlen (dir);
if (IS_DIR_SEPARATOR (dir[len - 1]))
{
/* Remove the trailing slash unless this is a root directory
(including a drive letter on non-Unix systems). */
- if (!(len == 1) /* "/" */
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- && !(len == 3 && dir[1] == ':') /* "d:/" */
-#endif
- )
- len--;
+ if (have_dos_based_file_system())
+ {
+ if (!(len == 1) /* "/" */ && !(len == 3 && dir[1] == ':') /* "d:/" */)
+ len--;
+ }
+ else
+ {
+ if (!(len == 1)) /* "/" */
+ len--;
+ }
}
dir = savestring (dir, len);
Index: include/filenames.h
===================================================================
RCS file: /cvs/src/src/include/filenames.h,v
retrieving revision 1.5
diff -u -r1.5 filenames.h
--- include/filenames.h 21 Mar 2008 23:40:18 -0000 1.5
+++ include/filenames.h 20 Sep 2009 15:43:14 -0000
@@ -5,7 +5,7 @@
use forward- and back-slash in path names interchangeably, and
some of them have case-insensitive file names.
- Copyright 2000, 2001, 2007 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2007, 2009 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -30,25 +30,30 @@
extern "C" {
#endif
-#if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__)
+/* Defined in gdb/top.c
+
+ This determines whether we have
+ as a separator : / or \
+ a prefix [a-z]: or not
+ Replaces HAVE_DOS_BASED_FILE_SYSTEM and FILENAME_PREFIX_LEN.
+
+ Case sensitive/insensitive file name comparison is *not* influenced by this. */
+
+extern int have_dos_based_file_system(void);
+extern void set_dos_based_file_system(int);
+
+#define _isalpha(c) (((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')))
+
+#define IS_DIR_SEPARATOR(c) \
+ ((have_dos_based_file_system()) ? \
+ ((c == '/') || (c == '\\')) : \
+ (c == '/'))
+
+#define IS_ABSOLUTE_PATH(f) \
+ ((IS_DIR_SEPARATOR(f[0])) ? 1 : \
+ (have_dos_based_file_system() ? (_isalpha(f[0]) && (f[1] == ':')) : 0))
-#ifndef HAVE_DOS_BASED_FILE_SYSTEM
-#define HAVE_DOS_BASED_FILE_SYSTEM 1
-#endif
-
-#define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\')
-/* Note that IS_ABSOLUTE_PATH accepts d:foo as well, although it is
- only semi-absolute. This is because the users of IS_ABSOLUTE_PATH
- want to know whether to prepend the current working directory to
- a file name, which should not be done with a name like d:foo. */
-#define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || (((f)[0]) && ((f)[1] == ':')))
-
-#else /* not DOSish */
-
-#define IS_DIR_SEPARATOR(c) ((c) == '/')
-#define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]))
-
-#endif /* not DOSish */
+#define DIR_SEPARATOR (have_dos_based_file_system() ? '\\' : '/')
extern int filename_cmp (const char *s1, const char *s2);
#define FILENAME_CMP(s1, s2) filename_cmp(s1, s2)
Index: libiberty/Makefile.in
===================================================================
RCS file: /cvs/src/src/libiberty/Makefile.in,v
retrieving revision 1.99
diff -u -r1.99 Makefile.in
--- libiberty/Makefile.in 23 Aug 2009 19:03:58 -0000 1.99
+++ libiberty/Makefile.in 20 Sep 2009 15:43:15 -0000
@@ -127,7 +127,7 @@
cp-demint.c cplus-dem.c crc32.c \
dyn-string.c \
fdmatch.c ffs.c fibheap.c filename_cmp.c floatformat.c \
- fnmatch.c fopen_unlocked.c \
+ filesystem.c fnmatch.c fopen_unlocked.c \
getcwd.c getopt.c getopt1.c getpagesize.c getpwd.c getruntime.c \
gettimeofday.c \
hashtab.c hex.c \
@@ -163,7 +163,7 @@
./choose-temp.o ./concat.o ./cp-demint.o ./crc32.o \
./dyn-string.o \
./fdmatch.o ./fibheap.o ./filename_cmp.o ./floatformat.o \
- ./fnmatch.o ./fopen_unlocked.o \
+ ./fnmatch.o ./fopen_unlocked.o ./filesystem.o \
./getopt.o ./getopt1.o ./getpwd.o ./getruntime.o \
./hashtab.o ./hex.o \
./lbasename.o ./lrealpath.o \
@@ -502,7 +502,8 @@
$(COMPILE.c) $(srcdir)/atexit.c $(OUTPUT_OPTION)
./basename.o: $(srcdir)/basename.c config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h
+ $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/basename.c -o pic/$@; \
else true; fi
@@ -628,6 +629,12 @@
else true; fi
$(COMPILE.c) $(srcdir)/filename_cmp.c $(OUTPUT_OPTION)
+./filesystem.o: $(srcdir)/filesystem.c
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/filesystem.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/filesystem.c $(OUTPUT_OPTION)
+
./floatformat.o: $(srcdir)/floatformat.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/floatformat.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
@@ -736,7 +743,8 @@
$(COMPILE.c) $(srcdir)/lrealpath.c $(OUTPUT_OPTION)
./make-relative-prefix.o: $(srcdir)/make-relative-prefix.c config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+ $(INCDIR)/ansidecl.h $(INCDIR)/filenames.h \
+ $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/make-relative-prefix.c -o pic/$@; \
else true; fi
Index: libiberty/basename.c
===================================================================
RCS file: /cvs/src/src/libiberty/basename.c,v
retrieving revision 1.5
diff -u -r1.5 basename.c
--- libiberty/basename.c 16 Apr 2005 01:05:04 -0000 1.5
+++ libiberty/basename.c 20 Sep 2009 15:43:15 -0000
@@ -19,36 +19,16 @@
#include "libiberty.h"
#include "safe-ctype.h"
-#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- defined (__OS2__)
-#define HAVE_DOS_BASED_FILE_SYSTEM
-#ifndef DIR_SEPARATOR_2
-#define DIR_SEPARATOR_2 '\\'
-#endif
-#endif
-
-/* Define IS_DIR_SEPARATOR. */
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
+#include "filenames.h"
char *
basename (const char *name)
{
const char *base;
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
/* Skip over the disk name in MSDOS pathnames. */
- if (ISALPHA (name[0]) && name[1] == ':')
+ if (have_dos_based_file_system() && ISALPHA (name[0]) && name[1] == ':')
name += 2;
-#endif
for (base = name; *name; name++)
{
Index: libiberty/filename_cmp.c
===================================================================
RCS file: /cvs/src/src/libiberty/filename_cmp.c,v
retrieving revision 1.4
diff -u -r1.4 filename_cmp.c
--- libiberty/filename_cmp.c 3 May 2007 23:40:11 -0000 1.4
+++ libiberty/filename_cmp.c 20 Sep 2009 15:43:15 -0000
@@ -50,29 +50,28 @@
int
filename_cmp (const char *s1, const char *s2)
{
-#ifndef HAVE_DOS_BASED_FILE_SYSTEM
- return strcmp(s1, s2);
-#else
- for (;;)
- {
- int c1 = TOLOWER (*s1);
- int c2 = TOLOWER (*s2);
+ if (! have_dos_based_file_system())
+ return strcmp(s1, s2);
+ else
+ for (;;)
+ {
+ int c1 = TOLOWER (*s1);
+ int c2 = TOLOWER (*s2);
- /* On DOS-based file systems, the '/' and the '\' are equivalent. */
- if (c1 == '/')
- c1 = '\\';
- if (c2 == '/')
- c2 = '\\';
+ /* On DOS-based file systems, the '/' and the '\' are equivalent. */
+ if (c1 == '/')
+ c1 = '\\';
+ if (c2 == '/')
+ c2 = '\\';
- if (c1 != c2)
- return (c1 - c2);
+ if (c1 != c2)
+ return (c1 - c2);
- if (c1 == '\0')
- return 0;
+ if (c1 == '\0')
+ return 0;
- s1++;
- s2++;
- }
-#endif
+ s1++;
+ s2++;
+ }
}
Index: libiberty/lbasename.c
===================================================================
RCS file: /cvs/src/src/libiberty/lbasename.c,v
retrieving revision 1.8
diff -u -r1.8 lbasename.c
--- libiberty/lbasename.c 10 May 2005 15:33:33 -0000 1.8
+++ libiberty/lbasename.c 20 Sep 2009 15:43:15 -0000
@@ -50,11 +50,9 @@
{
const char *base;
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
/* Skip over a possible disk name. */
- if (ISALPHA (name[0]) && name[1] == ':')
+ if (have_dos_based_file_system() && ISALPHA (name[0]) && name[1] == ':')
name += 2;
-#endif
for (base = name; *name; name++)
if (IS_DIR_SEPARATOR (*name))
Index: libiberty/make-relative-prefix.c
===================================================================
RCS file: /cvs/src/src/libiberty/make-relative-prefix.c,v
retrieving revision 1.12
diff -u -r1.12 make-relative-prefix.c
--- libiberty/make-relative-prefix.c 24 Mar 2008 18:06:37 -0000 1.12
+++ libiberty/make-relative-prefix.c 20 Sep 2009 15:43:16 -0000
@@ -62,6 +62,7 @@
#include "ansidecl.h"
#include "libiberty.h"
+#include "filenames.h"
#ifndef R_OK
#define R_OK 4
@@ -69,29 +70,9 @@
#define X_OK 1
#endif
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-#endif
+#define HOST_EXECUTABLE_SUFFIX ".exe"
-#if defined (_WIN32) || defined (__MSDOS__) \
- || defined (__DJGPP__) || defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define HAVE_HOST_EXECUTABLE_SUFFIX
-# define HOST_EXECUTABLE_SUFFIX ".exe"
-# ifndef DIR_SEPARATOR_2
-# define DIR_SEPARATOR_2 '\\'
-# endif
-# define PATH_SEPARATOR ';'
-#else
-# define PATH_SEPARATOR ':'
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else
-# define IS_DIR_SEPARATOR(ch) \
- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif
+#define PATH_SEPARATOR (have_dos_based_file_system() ? ';' : ':')
#define DIR_UP ".."
@@ -122,13 +103,11 @@
/* Count the number of directories. Special case MSDOS disk names as part
of the initial directory. */
p = name;
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- if (name[1] == ':' && IS_DIR_SEPARATOR (name[2]))
+ if (have_dos_based_file_system() && name[1] == ':' && IS_DIR_SEPARATOR (name[2]))
{
p += 3;
num_dirs++;
}
-#endif /* HAVE_DOS_BASED_FILE_SYSTEM */
while ((ch = *p++) != '\0')
{
@@ -147,8 +126,7 @@
/* Now copy the directory parts. */
num_dirs = 0;
p = name;
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- if (name[1] == ':' && IS_DIR_SEPARATOR (name[2]))
+ if (have_dos_based_file_system() && name[1] == ':' && IS_DIR_SEPARATOR (name[2]))
{
dirs[num_dirs++] = save_string (p, 3);
if (dirs[num_dirs - 1] == NULL)
@@ -158,7 +136,6 @@
}
p += 3;
}
-#endif /* HAVE_DOS_BASED_FILE_SYSTEM */
q = p;
while ((ch = *p++) != '\0')
@@ -273,9 +250,8 @@
}
strcat (nstore, progname);
if (! access (nstore, X_OK)
-#ifdef HAVE_HOST_EXECUTABLE_SUFFIX
- || ! access (strcat (nstore, HOST_EXECUTABLE_SUFFIX), X_OK)
-#endif
+ || (have_dos_based_file_system() &&
+ ! access (strcat (nstore, HOST_EXECUTABLE_SUFFIX), X_OK))
)
{
progname = nstore;