summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2009-12-11 12:02:45 +0000
committerEli Zaretskii <eliz@gnu.org>2009-12-11 12:02:45 +0000
commitdeace771d64683596218c63415e18ebef216fb34 (patch)
treed042cc23f7d880d378c850cb3917614467937df6
parentf4d9937274de3960f3af7356e1581163bafb93c3 (diff)
downloadgunmake-deace771d64683596218c63415e18ebef216fb34.tar.gz
(lookup_file) [HAVE_DOS_PATHS]: Treat '\\' like we do with '/'.
-rw-r--r--file.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/file.c b/file.c
index 61a6525..d068b34 100644
--- a/file.c
+++ b/file.c
@@ -103,10 +103,20 @@ lookup_file (const char *name)
while (name[0] == '[' && name[1] == ']' && name[2] != '\0')
name += 2;
#endif
- while (name[0] == '.' && name[1] == '/' && name[2] != '\0')
+ while (name[0] == '.'
+#ifdef HAVE_DOS_PATHS
+ && (name[1] == '/' || name[1] == '\\')
+#else
+ && name[1] == '/'
+#endif
+ && name[2] != '\0')
{
name += 2;
- while (*name == '/')
+ while (*name == '/'
+#ifdef HAVE_DOS_PATHS
+ || *name == '\\'
+#endif
+ )
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
++name;
}