summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-05-29 14:52:11 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-05-29 14:52:11 +0000
commit0c90355e8ac5e10c0c92caaaa9a446c106493b14 (patch)
treecf728511b114b6d336543c515d3dc842bff97b56 /usr.bin
parentc6b96926ea963df4dd583667ee592e0081324c6f (diff)
The case-insensitive flag (c) for string and search tests doesn't make
the entire match case sensitive, only lower case characters.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/file/magic-test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/file/magic-test.c b/usr.bin/file/magic-test.c
index 128116d6785..7394c0fbcb2 100644
--- a/usr.bin/file/magic-test.c
+++ b/usr.bin/file/magic-test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: magic-test.c,v 1.3 2015/04/25 16:35:47 brynet Exp $ */
+/* $OpenBSD: magic-test.c,v 1.4 2015/05/29 14:52:10 nicm Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -38,7 +38,7 @@ magic_one_eq(char a, char b, int cflag)
{
if (a == b)
return (1);
- if (cflag && tolower((u_char)a) == tolower((u_char)b))
+ if (cflag && islower((u_char)b) && tolower((u_char)a) == (u_char)b)
return (1);
return (0);
}