From owner-freebsd-bugs Sun Jul 13 10:51:42 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id KAA00788 for bugs-outgoing; Sun, 13 Jul 1997 10:51:42 -0700 (PDT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id KAA00782 for ; Sun, 13 Jul 1997 10:51:32 -0700 (PDT) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id TAA11019; Sun, 13 Jul 1997 19:51:13 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.8.5/8.8.5) id TAA16851; Sun, 13 Jul 1997 19:31:38 +0200 (MET DST) Message-ID: <19970713193138.DB37367@uriah.heep.sax.de> Date: Sun, 13 Jul 1997 19:31:38 +0200 From: j@uriah.heep.sax.de (J Wunsch) To: r.carey@dcs.napier.ac.uk (Robin Carey) Cc: hoek@hwcn.org (Tim Vanderhoek), freebsd-bugs@FreeBSD.ORG Subject: Re: ispunct(3) [was: FreeBSD-2.1.1] References: X-Mailer: Mutt 0.60_p2-3,5,8-9 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: ; from Robin Carey on Jul 13, 1997 15:55:17 +0100 Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Robin Carey wrote: > > > 1) ispunct(3) doesn't work :) It returns TRUE for characters which are > > > not punctuation. To see what I mean, try this program: > > > > Reading the manpage, the output of your demonstration program > > looks about right... > > Huh ? > Doesn't work on my FreeBSD-2.2.1 system .... > The ispunct(3) routine returns TRUE for characters which are not punctuation > and not in the man page, on my computer anyway. For me, it does return true for exactly those characters mentioned in the man page (neglecting the fact that the man page didn't get the backslash right): j@uriah 157% cat foo.c #include #include int main(void) { int c; for (c = 0; c < 128; c++) if (ispunct(c)) putchar(c); putchar('\n'); return 0; } j@uriah 158% cc -O foo.c j@uriah 159% ./a.out !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ Note that the man page talks about ASCII characters, ispunct(3) also returns true for the punctuation characters of ISO Latin-1, if you extend the range above to < 256. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)