summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2020-02-20 05:27:25 -0800
committerJohn Levon <john.levon@joyent.com>2020-02-25 09:48:41 -0800
commitf3a525d949e26238340eb8c1f6fdcfff91fc7e65 (patch)
tree89e61172799bce3cd6ddebaf60d490e5b042e4ed /usr/src/cmd
parent2bcbf80ce6c8a2fb827428428c350ebe4f91f7ab (diff)
downloadillumos-joyent-f3a525d949e26238340eb8c1f6fdcfff91fc7e65.tar.gz
12328 FNMPERIOD makes little sense for find -path
Reviewed by: Andy Fiddaman <andy@omniosce.org> Approved by: Robert Mustacchi <rm@fingolfin.org>
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/find/find.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr/src/cmd/find/find.c b/usr/src/cmd/find/find.c
index 5b5811ea6a..8860e9b711 100644
--- a/usr/src/cmd/find/find.c
+++ b/usr/src/cmd/find/find.c
@@ -22,6 +22,7 @@
* Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2013 Andrew Stormont. All rights reserved.
+ * Copyright 2020 Joyent, Inc.
*/
@@ -1027,9 +1028,12 @@ execute(const char *name, const struct stat *statb, int type, struct FTW *state)
* /usr/bin/find will not pattern match a leading
* '.' in a filename, unless '.' is explicitly
* specified.
+ *
+ * The legacy behavior makes no sense for PATH.
*/
#ifndef XPG4
- fnmflags |= FNM_PERIOD;
+ if (np->action == NAME || np->action == INAME)
+ fnmflags |= FNM_PERIOD;
#endif
val = !fnmatch(np->first.cp,