summaryrefslogtreecommitdiff
path: root/usr.bin/locate
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2010-10-25 19:16:46 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2010-10-25 19:16:46 +0000
commit336112b5b5e777eefc194a5f063f14fc2eae3976 (patch)
tree1f60427993a487579ffa2c18229d7caaa3004498 /usr.bin/locate
parent8a295ab043f08f127c63dd69d1cb5545f70d9f73 (diff)
Add missing FNM_CASEFOLD flag to fnmatch() when locate is run in case
insensitive mode. From Geoff Steckel. OK deraadt@
Diffstat (limited to 'usr.bin/locate')
-rw-r--r--usr.bin/locate/locate/fastfind.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c
index 27353a4af4a..a366f4cd572 100644
--- a/usr.bin/locate/locate/fastfind.c
+++ b/usr.bin/locate/locate/fastfind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fastfind.c,v 1.10 2009/06/04 07:19:45 espie Exp $ */
+/* $OpenBSD: fastfind.c,v 1.11 2010/10/25 19:16:45 millert Exp $ */
/*
* Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: fastfind.c,v 1.10 2009/06/04 07:19:45 espie Exp $
+ * $Id: fastfind.c,v 1.11 2010/10/25 19:16:45 millert Exp $
*/
#ifndef _LOCATE_STATISTIC_
@@ -305,7 +305,12 @@ fastfind
shortpath = basename(path);
if ((!f_basename && (!globflag ||
+#ifdef FF_ICASE
+ !fnmatch(pathpart, shortpath,
+ FNM_CASEFOLD)))
+#else
!fnmatch(pathpart, shortpath, 0)))
+#endif /* FF_ICASE */
|| (strstr(shortpath, pathpart) !=
NULL)) {
if (f_silent)