Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jul 1997 14:03:44 +0100 (BST)
From:      Robin Carey <r.carey@dcs.napier.ac.uk>
To:        J Wunsch <j@uriah.heep.sax.de>
Cc:        Robin Carey <r.carey@dcs.napier.ac.uk>, Tim Vanderhoek <hoek@hwcn.org>, freebsd-bugs@FreeBSD.ORG
Subject:   Re: ispunct(3) [was: FreeBSD-2.1.1]
Message-ID:  <Pine.SOL.3.91.970714135123.19515B-100000@artemis>
In-Reply-To: <19970713193138.DB37367@uriah.heep.sax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <stdio.h>
> #include <ctype.h>
> 
> 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. ;-)
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.3.91.970714135123.19515B-100000>