(lookup_file) [HAVE_DOS_PATHS]: Treat '\\' like we do with '/'.

This commit is contained in:
Eli Zaretskii 2009-12-11 12:02:45 +00:00
parent f4d9937274
commit deace771d6

14
file.c
View file

@ -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;
}