From d15405ca586301f1fc6d2e7f14c301bede15c657 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 4 Aug 1993 22:21:35 +0000 Subject: [PATCH] The utility procedure `strcmp_ci' had a built-in assumption that the input strings contained no uppercase letters. This is not the case. The procedure `toupper' is guaranteed to work on all characters iff the implementation is ANSI compliant. The procedure `_toupper' (ant `toupper' in non-ANSI implementations) is guaranteed to work _only_ on lowercase letters. --- v7/src/microcode/primutl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v7/src/microcode/primutl.c b/v7/src/microcode/primutl.c index 128beeff5..6a1c4fabc 100644 --- a/v7/src/microcode/primutl.c +++ b/v7/src/microcode/primutl.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: primutl.c,v 9.63 1993/08/03 22:26:15 gjr Exp $ +$Id: primutl.c,v 9.64 1993/08/04 22:21:35 cph Exp $ Copyright (c) 1988-1993 Massachusetts Institute of Technology @@ -116,8 +116,8 @@ DEFUN (strcmp_ci, (s1, s2), fast char * s1 AND fast char * s2) { fast int c1 = (*s1++); fast int c2 = (*s2++); - c1 = (_toupper (c1)); - c2 = (_toupper (c2)); + if (islower (c1)) c1 = (_toupper (c1)); + if (islower (c2)) c2 = (_toupper (c2)); diff = (c1 - c2); if (diff != 0) return ((diff > 0) ? 1 : -1); -- 2.25.1