summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>1997-04-29 03:27:21 +0000
committerJohn Polstra <jdp@FreeBSD.org>1997-04-29 03:27:21 +0000
commit9e0a20e6bd7261a07eb07200fcc78993fe664ae3 (patch)
tree778c85ce5956c2cdd7db4a69eee502b71023f809 /lib
parent5d8ff3922a918dfc33a039607dea3e549bb07194 (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/fnmatch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c
index f53963adf899..f5e99f00111d 100644
--- a/lib/libc/gen/fnmatch.c
+++ b/lib/libc/gen/fnmatch.c
@@ -93,7 +93,8 @@ fnmatch(pattern, string, flags)
/* Optimize for pattern with * at end or before /. */
if (c == EOS)
if (flags & FNM_PATHNAME)
- return (strchr(string, '/') == NULL ?
+ return ((flags & FNM_LEADING_DIR) ||
+ strchr(string, '/') == NULL ?
0 : FNM_NOMATCH);
else
return (0);