diff options
author | Bruno Haible <bruno@clisp.org> | 2020-03-28 14:06:05 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-03-28 14:06:05 +0100 |
commit | d98fe81b8848176d7054eccac5e6352b1eb216b6 (patch) | |
tree | f3ad189e26462871dc6142ad9eaadc4de4f8d8b9 /lib/progreloc.c | |
parent | 79e056e5a0394b75dd38772697b495d60e2c3b3f (diff) | |
download | gnulib-d98fe81b8848176d7054eccac5e6352b1eb216b6.tar.gz |
filename: Copy some definitions from module 'dosname'.
* lib/filename.h: Include <string.h>, for IS_FILE_NAME_WITH_DIR.
(HAS_DEVICE): Document macro.
(FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE): New macro.
(IS_ABSOLUTE_FILE_NAME): Consider
FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE.
(IS_RELATIVE_FILE_NAME, IS_FILE_NAME_WITH_DIR): New macros.
(IS_ABSOLUTE_PATH, IS_PATH_WITH_DIR): Define as deprecated aliases.
* lib/relocatable.c (IS_FILE_NAME_WITH_DIR): Renamed from
IS_PATH_WITH_DIR.
(DllMain): Update.
* lib/progreloc.c (IS_FILE_NAME_WITH_DIR): Renamed from
IS_PATH_WITH_DIR.
(find_executable): Update.
* NEWS: Document the deprecations.
Diffstat (limited to 'lib/progreloc.c')
-rw-r--r-- | lib/progreloc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/progreloc.c b/lib/progreloc.c index 2acf3fb33f..b555211317 100644 --- a/lib/progreloc.c +++ b/lib/progreloc.c @@ -76,8 +76,8 @@ extern char * canonicalize_file_name (const char *name); /* Pathname support. - ISSLASH(C) tests whether C is a directory separator character. - IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. + ISSLASH(C) tests whether C is a directory separator character. + IS_FILE_NAME_WITH_DIR(P) tests whether P contains a directory specification. */ #if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__ /* Native Windows, OS/2, DOS */ @@ -85,13 +85,13 @@ extern char * canonicalize_file_name (const char *name); # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') -# define IS_PATH_WITH_DIR(P) \ +# define IS_FILE_NAME_WITH_DIR(P) \ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) # define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) #else /* Unix */ # define ISSLASH(C) ((C) == '/') -# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) +# define IS_FILE_NAME_WITH_DIR(P) (strchr (P, '/') != NULL) # define FILE_SYSTEM_PREFIX_LEN(P) 0 #endif @@ -206,7 +206,7 @@ find_executable (const char *argv0) int length = GetModuleFileName (NULL, location, sizeof (location)); if (length < 0) return NULL; - if (!IS_PATH_WITH_DIR (location)) + if (!IS_FILE_NAME_WITH_DIR (location)) /* Shouldn't happen. */ return NULL; return xstrdup (location); |