From owner-freebsd-bugs Mon Jul 14 06:01:46 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id GAA19883 for bugs-outgoing; Mon, 14 Jul 1997 06:01:46 -0700 (PDT) Received: from hades.dcs.napier.ac.uk (hades.dcs.napier.ac.uk [146.176.161.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id GAA19876 for ; Mon, 14 Jul 1997 06:01:41 -0700 (PDT) Received: from artemis.dcs.napier.ac.uk (artemis [146.176.161.5]) by hades.dcs.napier.ac.uk (8.7.3/8.7.3) with ESMTP id OAA22878; Mon, 14 Jul 1997 14:03:46 +0100 (BST) Received: (from bsc4093@localhost) by artemis.dcs.napier.ac.uk (8.7.3/8.7.3) id OAA19617; Mon, 14 Jul 1997 14:03:45 +0100 (BST) Date: Mon, 14 Jul 1997 14:03:44 +0100 (BST) From: Robin Carey To: J Wunsch cc: Robin Carey , Tim Vanderhoek , freebsd-bugs@FreeBSD.ORG Subject: Re: ispunct(3) [was: FreeBSD-2.1.1] In-Reply-To: <19970713193138.DB37367@uriah.heep.sax.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sun, 13 Jul 1997, J Wunsch wrote: > As Robin Carey wrote: > > > 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 > !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ My original program differed to the above, approximately (in terms of your code): .... for (c = 0; c < 256; c++) .... And my results were different; ispunct(3) was returning TRUE for chars above 127 ..... > > 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. Oh ... the manual page doesn't mention anything about characters other than ASCII. Doesn't that mean ispunct(3) is not "ANSI C" standard then ? Cheers. > > -- > 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. ;-) >