Roff in C and iscntrl()

guido at boring.UUCP guido at boring.UUCP
Sat Jan 5 03:41:26 AEST 1985


In article <6932 at brl-tgr.ARPA> gwyn at brl-tgr.ARPA (Doug Gwyn <gwyn>) writes:
>I wonder how ANYone could have decided that e.g. LF is NOT a control
>character?  (I'm sure the 4.2BSD fans will think that makes sense!)

This was already in the original v7 ctype.h.  It would not have been such
a problem if they had documented it clearly (e.g. by putting the whole
table in the manual page), but the manual page supplied with v7 was, alas,
very vague about the actual assignments.  I remember that the space was
not considered a 'printing' character!  (This has been fixed in all BSD
versions I know of, at least, and I suppose also in sys3/sys5.)

When one first checks for 'isspace' and only then for 'iscntrl',
everything goes well.  I guess the original idea was that 'isspace',
'iscntrl' and 'isprint' would designate disjunct sets, whose union whas
the whole ASCII set (0-177 octal).

	Guido van Rossum, "Stamp Out BASIC" Committee, CWI, Amsterdam
	guido at mcvax.UUCP



More information about the Comp.lang.c mailing list