diff options
author | Eli Zaretskii <eliz@gnu.org> | 2001-06-04 07:45:08 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2001-06-04 07:45:08 +0000 |
commit | fe4e3eb861f34aedece88a642124ef1b0601cf4d (patch) | |
tree | 4f338782875e8c0036cecbbc6a96d4aa5b89639e /gdb/solib.c | |
parent | 37ba1196cfa445fc376f312d4152486692ce50b1 (diff) | |
download | gdb-fe4e3eb861f34aedece88a642124ef1b0601cf4d.zip gdb-fe4e3eb861f34aedece88a642124ef1b0601cf4d.tar.gz gdb-fe4e3eb861f34aedece88a642124ef1b0601cf4d.tar.bz2 |
* source.c (mod_path, openp): Use HAVE_DOS_BASED_FILE_SYSTEM
instead of system-specific define's like _WIN32 and __MSDOS__.
Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH instead of SLASH_P and
ROOTED_P.
(top-level): #include "filenames.h".
* solib.c (solib_open): Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH
instead of SLASH_CHAR, ROOTED_P and SLASH_P.
(top-level): #include "filenames.h".
* defs.h (SLASH_P, SLASH_CHAR, ROOTED_P): Remove definitions.
(SLASH_STRING): Define only for _WIN32.
* completer.c: Use HAVE_DOS_BASED_FILE_SYSTEM instead of
__MSDOS_.
* cli/cli-cmds.c (cd_command): Use IS_DIR_SEPARATOR and
IS_ABSOLUTE_PATH instead of SLASH_P and ROOTED_P. Replace
system-specific ifdefs with HAVE_DOS_BASED_FILE_SYSTEM.
(top-level): #include "filenames.h".
Diffstat (limited to 'gdb/solib.c')
-rw-r--r-- | gdb/solib.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/solib.c b/gdb/solib.c index 8a5a904..dfcca0c 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -39,6 +39,7 @@ #include "language.h" #include "gdbcmd.h" #include "completer.h" +#include "filenames.h" /* for DOSish file names */ #include "solist.h" @@ -101,10 +102,14 @@ solib_open (char *in_pathname, char **found_pathname) { int found_file = -1; char *temp_pathname = NULL; + char *p = in_pathname; - if (strchr (in_pathname, SLASH_CHAR)) + while (*p && !IS_DIR_SEPARATOR (*p)) + p++; + + if (*p) { - if (! ROOTED_P (in_pathname) || solib_absolute_prefix == NULL) + if (! IS_ABSOLUTE_PATH (in_pathname) || solib_absolute_prefix == NULL) temp_pathname = in_pathname; else { @@ -112,7 +117,7 @@ solib_open (char *in_pathname, char **found_pathname) /* Remove trailing slashes from absolute prefix. */ while (prefix_len > 0 - && SLASH_P (solib_absolute_prefix[prefix_len - 1])) + && IS_DIR_SEPARATOR (solib_absolute_prefix[prefix_len - 1])) prefix_len--; /* Cat the prefixed pathname together. */ |