summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-11-14 20:13:30 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-11-14 20:13:30 +0000
commitc95bc17647684be4d3cca1105cdad35c1a31f3be (patch)
treea286f70a832fec56381dd7d73bc7951ca999dcb1
parent726bd012037be8fdd455dddaaa9746db519873ae (diff)
Correct check flipped in earlier commit.
Eliminate unnecessary isupper() tests before tolower() use ok millert@
-rw-r--r--usr.bin/less/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/less/main.c b/usr.bin/less/main.c
index abea6389442..6c35776c99f 100644
--- a/usr.bin/less/main.c
+++ b/usr.bin/less/main.c
@@ -350,13 +350,12 @@ sprefix(char *ps, char *s, int uppercase)
for (; *s != '\0'; s++, ps++) {
c = *ps;
if (uppercase) {
- if (len == 0 && isupper(c))
+ if (len == 0 && islower(c))
return (-1);
- if (isupper(c))
- c = tolower(c);
+ c = tolower(c);
}
sc = *s;
- if (len > 0 && isupper(sc))
+ if (len > 0)
sc = tolower(sc);
if (c != sc)
break;