DragonFly BSD
DragonFly commits List (threaded) for 2005-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: ctype bug

From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Thu, 7 Jul 2005 02:24:13 +0200
Mail-followup-to: commits@crater.dragonflybsd.org

On Wed, Jul 06, 2005 at 05:09:40PM -0700, Matthew Dillon wrote:
> :Matt, the ctype macros ALWAYS worked like this, at the very least back to
> :the days of 4.4BSD. THIS IS NOT NEW. Just because some programmers don't like
> :reading the documentation and follow what is clearly written there, doesn't mean
> :that arbitrary changes are correct.
> :
> :Joerg
>     No, they never worked like this.  Go back and look at rev 1.1 of
>     ctype.h in the FreeBSD source repository.  Guess what it does?  It
>     does a range check.

Where? It masks the high bits off, there by mapping 255 and -1 to the same value.
That's not correct.

Just to go back a bit in time, Sys V7 doesn't have any boundary checks:

3BSD doesn't have it. http://unix-archive.kalwun.de/4BSD/Distributions/3bsd.tar.gz

Net/2 doesn't have it. http://unix-archive.kalwun.de/4BSD/Distributions/Net2/net2.tar.gz

NetBSD never changed that, either.

So we are talking about a pure FreeBSDism here. And as I pointed out more than once,
they implemented it incorrectly for anything but the C locale in the past.


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]