summaryrefslogtreecommitdiff
path: root/src/vpath.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2022-10-17 23:36:36 -0400
committerPaul Smith <psmith@gnu.org>2022-10-18 14:20:44 -0400
commit7bb7bb4ba49967e71abf14d7d59036b9a0eddf93 (patch)
tree2895b178787d4028941a4ef116ec4365ac5f8b24 /src/vpath.c
parentb79791533bf2a784bf201fbb9f63588ef24fc404 (diff)
downloadmake-git-7bb7bb4ba49967e71abf14d7d59036b9a0eddf93.tar.gz
Add ISDIRSEP() helper macro and use it
Create a ISDIRSEP() macro to check for directory separator chars using the stopchar_map, and replace inline checks and explicit STOP_SET calls with this macro. * src/makeint.h (ISDIRSEP): Create the macro using MAP_DIRSEP. * src/dir.c (find_directory): Replace inline checks with ISDIRSEP. (file_exists_p): Ditto. (file_impossible): Ditto. (file_impossible_p): Ditto. (local_stat): Ditto. * src/file.c (lookup_file): Ditto. * src/function.c (abspath): Ditto. * src/job.c (_is_unixy_shell): Ditto. (is_bourne_compatible_shell): Ditto. (construct_command_argv): Ditto. * src/main.c (find_and_set_default_shell): Ditto. (main): Ditto. * src/read.c (eval): Ditto. (parse_file_seq): Ditto. * src/remake.c (name_mtime): Ditto. * src/vpath.c (construct_vpath_list): Ditto.
Diffstat (limited to 'src/vpath.c')
-rw-r--r--src/vpath.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/vpath.c b/src/vpath.c
index 203fca1b..343e3446 100644
--- a/src/vpath.c
+++ b/src/vpath.c
@@ -239,8 +239,7 @@ construct_vpath_list (char *pattern, char *dirpath)
also define HAVE_DOS_PATHS would like us to recognize
colons after the drive letter in the likes of
"D:/foo/bar:C:/xyzzy". */
- && (*p != PATH_SEPARATOR_CHAR
- || (p == v + 1 && (p[1] == '/' || p[1] == '\\')))
+ && (*p != PATH_SEPARATOR_CHAR || (p == v + 1 && ISDIRSEP (p[1])))
#else
&& *p != PATH_SEPARATOR_CHAR
#endif