Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site bbncca.ARPA Path: utzoo!linus!vaxine!wjh12!bbncca!keesan From: keesan@bbncca.ARPA (Morris Keesan) Newsgroups: net.lang.c Subject: Re: Question about toupper and tolower Message-ID: <300@bbncca.ARPA> Date: Thu, 10-Nov-83 15:34:15 EST Article-I.D.: bbncca.300 Posted: Thu Nov 10 15:34:15 1983 Date-Received: Fri, 11-Nov-83 23:36:08 EST References: <1764@fortune.UUCP> Organization: Bolt, Beranek and Newman, Cambridge, Ma. Lines: 10 ------------------------------- The definitions of toupper and tolower on BBN UNIX systems were changed nearly three years ago to leave the character in the desired case if it already is. It doesn't appear to have broken anything in that amount of time. Incidentally, the efficient way to do this is NOT to build a definition that looks like (isupper(c)?(c):toupper(c)), but simply to replace the addition and subtraction operations with bitwise AND and OR operators to turn on or off the ASCII lower-case bit. Morris M. Keesan decvax!bbncca!keesan