Subject: Re: isprint() and isblank()
To: None <firstname.lastname@example.org, email@example.com>
From: Noriyuki Soda <firstname.lastname@example.org>
Date: 01/21/2001 05:23:50
> the patch has bad sideeffect: isprint('\t') result will go strange
> unless you recompile your binary.
> isprint('\t') isblank('\t')
> used to be: false false (incorrect)
I checked the behaviour on 1.4ish system and 1.5ish system.
And both systems returns correct answer as follows:
> correct one (if you recompile binaries and libc, it will be achieved):
> false true
Then, I checked our ctype.h and found the following definiton:
#define isblank(c) ((int)((_ctype_ + 1)[(int)(c)] & _B))
That is, the macro version of isblank() is never defined in NetBSD releases.
I next checked our isblank() implementation of libc. That is:
return(c == ' ' || c == '\t');
So, the "_B" bit in _ctype_ is only used for isprint() test,
and never used for isblank() test.
As itojun-san pointed out, we cannot set _B bit for '\t' character,
because it breaks isprint() implementation.
But it is not problem, because we do not actually use the _B bit,
and don't have to use it in future. We have to use for another
mechanism for isblank() implementation for loadable LC_CTYPE,