diff options
Diffstat (limited to 'implicit.c')
-rw-r--r-- | implicit.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -266,12 +266,15 @@ pattern_search (struct file *file, int archive, /* Set LASTSLASH to point at the last slash in FILENAME but not counting any slash at the end. (foo/bar/ counts as bar/ in directory foo/, not empty in directory foo/bar/.) */ + lastslash = strrchr (filename, '/'); #ifdef VMS - lastslash = strrchr (filename, ']'); - if (lastslash == 0) + if (lastslash == NULL) + lastslash = strrchr (filename, ']'); + if (lastslash == NULL) + lastslash = strrchr (filename, '>'); + if (lastslash == NULL) lastslash = strrchr (filename, ':'); -#else - lastslash = strrchr (filename, '/'); +#endif #ifdef HAVE_DOS_PATHS /* Handle backslashes (possibly mixed with forward slashes) and the case of "d:file". */ @@ -283,7 +286,6 @@ pattern_search (struct file *file, int archive, lastslash = filename + 1; } #endif -#endif if (lastslash != 0 && lastslash[1] == '\0') lastslash = 0; } @@ -339,10 +341,10 @@ pattern_search (struct file *file, int archive, if (lastslash) { #ifdef VMS - check_lastslash = (strchr (target, ']') == 0 - && strchr (target, ':') == 0); + check_lastslash = strpbrk (target, "/]>:") == NULL; #else check_lastslash = strchr (target, '/') == 0; +#endif #ifdef HAVE_DOS_PATHS /* Didn't find it yet: check for DOS-type directories. */ if (check_lastslash) @@ -351,7 +353,6 @@ pattern_search (struct file *file, int archive, check_lastslash = !(b || (target[0] && target[1] == ':')); } #endif -#endif } if (check_lastslash) { |