Path: utzoo!utgpu!cs.utexas.edu!samsung!olivea!oliveb!amdahl!key!beep!kris From: kris@beep.UUCP (Port'naybl) Newsgroups: alt.sources.d Subject: Re: bpe - binary patch editor Message-ID: <98@beep.UUCP> Date: 5 Nov 90 18:42:06 GMT References: <2188@sixhub.UUCP> <4902@taux01.nsc.com> <668@seer.UUCP> Distribution: alt Organization: The Three Gadgeteers Lines: 31 In article <668@seer.UUCP>, clh@seer.UUCP (Chris Hatch) writes: >In article <4902@taux01.nsc.com> amos@taux01.nsc.com (Amos Shapir) writes: >>The 'h' command doesn't work as distributed. To fix, precede each call to >>'toupper' in hexsrch.c by an appropriate 'if(islower(a))' test. >>(I wonder why people bother to post programs they never checked themselves >>even once - there's no way this could have worked on any UNIX version I know) On my System V.2 (beep), toupper (a) returns a unmodified if a is not a lower-case character. This seems right and proper to me. >Actually, by definition 'if (islower(a)) a=toupper(a);' should be the exact >same thing as 'a=toupper(a);'. If that is not the case, then your compiler >(or rather your library) is broken. This is in ANSI... Don't know about >the Unix "standards." One system (I will not name it) I worked on returned (a - 0x20) from toupper (a) and the corresponding tolower (a) returned (a + 0x20) for ALL valued of a. Took me a while to figure out that it WASN'T my program. I finally wrote a quick-and-dirty utility that displayed how the functions handled the various byte values that could be fed to them. This is how I discovered that toupper() and tolower() didn't act like I expected them. Now I keep a copy of this utility on each system I use. -- Port'naybl key!beep!kris woodowl!beep!kris "Look what they've done to my program, look what they've done to my code; They stuck it all on this floppy disk, and I think they got it wrong, ma..."