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 p9OGNZjQ005819 for ; Mon, 24 Oct 2011 12:23:36 -0400 (EDT) Received: from mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 8BA5014EA5F; Mon, 24 Oct 2011 18:23:29 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([130.237.32.160]) by mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) (amavisd-new, port 10024) with LMTP id TQp3xhr1m6x7; Mon, 24 Oct 2011 18:23:06 +0200 (CEST) X-KTH-Auth: kristaps [193.10.49.5] X-KTH-mail-from: kristaps@bsd.lv Received: from ctime.my.domain (ctime.hhs.se [193.10.49.5]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 4894C14E805; Mon, 24 Oct 2011 18:23:04 +0200 (CEST) Message-ID: <4EA590E8.4050805@bsd.lv> Date: Mon, 24 Oct 2011 18:23:04 +0200 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (X11; U; OpenBSD amd64; en-US; rv:1.9.2.13) Gecko/20110223 Thunderbird/3.1.7 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv CC: Ingo Schwarze Subject: Re: numbered character escape regression fix References: <20111022234605.GA20492@iris.usta.de> In-Reply-To: <20111022234605.GA20492@iris.usta.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > here is another fix for a regression that crept into one of the > recent releases. > > In groff, the handling of \N numbered character escapes is as follows: > > (1) If \N is followed by a digit, > the \N and one single following digit are ignored. > That is, "x\N123x" produces "x23x". > > (2) If \N is followed by a non-digit, > the next non-digit delimits the character number. > That is, "x\Nu65vx" produces "xAx". > The delimiting characters (here, u and v) need not match. > > Whatever mandoc currently does is different. > > I have no idea whether this applies to any of the other escapes > as well, but they are not nearly as important as \N. Ingo, This is fine---well, it's gross, but that's not our fault! The groff(7) manual doesn't documents this, but mandoc_char(7) should note it, as it's not intuitive to me at all and may result in confusion. > + /* > + * Special handling for the numbered character escape. > + * XXX Do any other escapes need similar handling? > + */ > + case ('N'): > + if ('\0' == cp[i]) > + return(ESCAPE_ERROR); > + *end =&cp[++i]; > + if (isdigit(cp[i-1])) > + return(ESCAPE_IGNORE); > + while (isdigit(**end)) > + (*end)++; You need a cast here to satisfy lint: isdigit(int) (unsigned char) is the common way of course. Thanks! Kristaps -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv