tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Cc: jmc@openbsd.org
Subject: Re: Non-ASCII check fails in main.c on OpenBSD
Date: Sun, 08 Aug 2010 16:27:31 +0200	[thread overview]
Message-ID: <4C5EBED3.1040904@bsd.lv> (raw)
In-Reply-To: <20100808124704.GC17816@iris.usta.de>

> i just noticed that on OpenBSD, the change main.c bsd.lv-rev. 1.99
> pathetically fails.  Non-ASCII characters are just passed through.
> 
> Now maybe that's a bug in OpenBSD isgraph(3), maybe it is not and
> isgraph(3) behaves like it does on purpose - actually, i don't really
> care that much either way, and i doubt that it will be easy to get
> OpenBSD isgraph(3) changed.
> 
> For maximum portability, i think when we put a comment
> 
>   /* 
>    * Warn about bogus characters.  If you're using
>    * non-ASCII encoding, you're screwing your
>    * readers.  Since I'd rather this not happen,
>    * I'll be helpful and drop these characters so
>    * we don't display gibberish.  Note to manual
>    * writers: use special characters.
>    */
> 
> which i fully agree with, we should also be explicit in the code,
> or we risk that on some systems our code behaves in another way than
> the comments make you think and than we intend, which is always bad.
> 
> So, as we want to drop non-ASCII, lets explicitely use isascii(3).
> 
> OK to commit to bsd.lv?
> 
> Of course, this will not be merged to OpenBSD until after unlock.

Ingo, good catch!  But yes, I tested this code on a GNU/Linux machine, 
never thinking that the behaviour would be different on OpenBSD.

Ok kristaps.
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2010-08-08 14:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-08 12:47 Ingo Schwarze
2010-08-08 14:27 ` Kristaps Dzonsons [this message]
2010-08-08 15:39 ` Joerg Sonnenberger
2010-08-08 18:52   ` Ingo Schwarze
2010-08-11 16:34     ` Ulrich Spörlein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C5EBED3.1040904@bsd.lv \
    --to=kristaps@bsd.lv \
    --cc=jmc@openbsd.org \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).