diff options
author | Paul Smith <psmith@gnu.org> | 2006-02-13 23:38:36 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2006-02-13 23:38:36 +0000 |
commit | df267b31c5dbe4d9fe774c63acc31ef0b804f902 (patch) | |
tree | c4273799026c73a44d15b6439fa17c14577a5318 /implicit.c | |
parent | a6bdc58385dc90037f0a43e9af92bbf0672adc5e (diff) | |
download | gunmake-df267b31c5dbe4d9fe774c63acc31ef0b804f902.tar.gz |
Fix bug #11183.
Diffstat (limited to 'implicit.c')
-rw-r--r-- | implicit.c | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -346,17 +346,28 @@ pattern_search (struct file *file, int archive, /* Set CHECK_LASTSLASH if FILENAME contains a directory prefix and the target pattern does not contain a slash. */ + check_lastslash = 0; + if (lastslash) + { #ifdef VMS - check_lastslash = lastslash != 0 - && ((strchr (target, ']') == 0) - && (strchr (target, ':') == 0)); + check_lastslash = (strchr (target, ']') == 0 + && strchr (target, ':') == 0); #else - check_lastslash = lastslash != 0 && strchr (target, '/') == 0; + check_lastslash = strchr (target, '/') == 0; +#ifdef HAVE_DOS_PATHS + /* Didn't find it yet: check for DOS-type directories. */ + if (!check_lastslash) + { + char *b = strrchr (target, '\\'); + check_lastslash = !(b ? b > lastslash + : (target[0] && target[1] == ':')); + } +#endif #endif + } if (check_lastslash) { - /* In that case, don't include the - directory prefix in STEM here. */ + /* If so, don't include the directory prefix in STEM here. */ unsigned int difference = lastslash - filename + 1; if (difference > stemlen) continue; |