Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.bugs Subject: Re: XENIX 3.0 toupper() and tolower() broken Message-ID: <6009@utzoo.UUCP> Date: Tue, 1-Oct-85 14:09:28 EDT Article-I.D.: utzoo.6009 Posted: Tue Oct 1 14:09:28 1985 Date-Received: Tue, 1-Oct-85 14:09:28 EDT References: <764@fisher.UUCP>, <195@chinet.UUCP> Organization: U of Toronto Zoology Lines: 18 Keywords: carelessness, idiot-proofing, history > This is not the only bug running around in toupper/tolower. While > some systems have this implementation, other versions (among which > is the Fortune) do not do any sanity check, they just add/subtract > 0x20, thus transforming numerals into control codes or letters, > depending on the direction of conversion... This was the original definition of toupper/tolower. It was not a bug; the domain of legal arguments was letters of the opposite case, period. This way if you knew the nature of the argument, the overhead of the check was unnecessary; if you didn't, you were supposed to do the check first. So many people were sloppy about it that inadequate domain checking became a characteristic error when using these macros. So the definition was eventually changed. Implementations that don't check are not buggy: they are conforming correctly to an earlier, and arguably less desirable (certainly less idiot-proof), version of the specs. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry Brought to you by Super Global Mega Corp .com