From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-2.sys.kth.se (smtp-2.sys.kth.se [130.237.32.160]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o78ERpb6013930 for ; Sun, 8 Aug 2010 10:27:51 -0400 (EDT) Received: from smtp-2.sys.kth.se (localhost [127.0.0.1]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 10F1514D846; Sun, 8 Aug 2010 16:27:45 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([127.0.0.1]) by smtp-2.sys.kth.se (smtp-2.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id FoBeHdSn3xgt; Sun, 8 Aug 2010 16:27:33 +0200 (CEST) X-KTH-Auth: kristaps [85.8.61.60] X-KTH-mail-from: kristaps@bsd.lv Received: from lappy.bsd.lv (h85-8-61-60.dynamic.se.alltele.net [85.8.61.60]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 341BB14C12E; Sun, 8 Aug 2010 16:27:32 +0200 (CEST) Message-ID: <4C5EBED3.1040904@bsd.lv> Date: Sun, 08 Aug 2010 16:27:31 +0200 From: Kristaps Dzonsons User-Agent: Thunderbird 2.0.0.16 (X11/20080812) X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv CC: jmc@openbsd.org Subject: Re: Non-ASCII check fails in main.c on OpenBSD References: <20100808124704.GC17816@iris.usta.de> In-Reply-To: <20100808124704.GC17816@iris.usta.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > 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