From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.rz.uni-karlsruhe.de (Debian-exim@smtp1.rz.uni-karlsruhe.de [129.13.185.217]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id oBQNUCSI024008 for ; Sun, 26 Dec 2010 18:30:12 -0500 (EST) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by smtp1.rz.uni-karlsruhe.de with esmtp (Exim 4.63 #1) id 1PX02U-0006Hv-4t; Mon, 27 Dec 2010 00:30:10 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1PX02U-0000lY-3K; Mon, 27 Dec 2010 00:30:10 +0100 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.69) (envelope-from ) id 1PX02U-0005qe-0s; Mon, 27 Dec 2010 00:30:10 +0100 Received: from schwarze by usta.de with local (Exim 4.72) (envelope-from ) id 1PX02T-0006z4-WE; Mon, 27 Dec 2010 00:30:10 +0100 Date: Mon, 27 Dec 2010 00:30:09 +0100 From: Ingo Schwarze To: discuss@mdocml.bsd.lv Cc: Nicolas Joly , Thomas Klausner Subject: Re: Sx quoting and Header Message-ID: <20101226233009.GM23914@iris.usta.de> References: <20101225152204.GY21954@danbala.tuwien.ac.at> X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101225152204.GY21954@danbala.tuwien.ac.at> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Thomas and Nicolas, gah, you are making *me* fix -Thtml bugs... :) Thomas Klausner wrote on Sat, Dec 25, 2010 at 04:22:04PM +0100: > 1. When the argument for .Sx is not quoted and contains a space, it > breaks the link. Example attached. The .Sx links differ as follows: > the one without the quotes has "20" in a place where the other has > "x20x". Shouldn't the argument of .Sx be taken as one item independent > on if it has quotes or not? Well, whether it is handled as one AST node internally or not is not that important here (using -Ttree, you see that it is indeed not the same, which does make sense in other contexts), but the bug here is that the ID generator ought to handle two words in the same way as one word with a blank in the middle. OK to commit the following patch? It makes sure the "x" protecting the beginning of the ID only gets added before the first word, not before each word. Thanks for reporting! Yours, Ingo > .Dd December 25, 2010 > .Dt TEST 1 > .Os > .Sh NAME > .Nm test > .Nd test page > .Sh DESCRIPTION > .Ss Programming Guide > See > .Sx "Programming Guide" > or > .Sx Programming Guide Index: html.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.c,v retrieving revision 1.123 diff -d -u -p -r1.123 html.c --- html.c 24 Dec 2010 14:14:00 -0000 1.123 +++ html.c 26 Dec 2010 23:10:43 -0000 @@ -771,20 +771,20 @@ html_idcat(char *dst, const char *src, i { int ssz; - assert(sz); + assert(sz > 2); /* Cf. . */ - for ( ; *dst != '\0' && sz; dst++, sz--) - /* Jump to end. */ ; - - assert(sz > 2); - /* We can't start with a number (bah). */ - *dst++ = 'x'; - *dst = '\0'; - sz--; + if ('\0' == *dst) { + *dst++ = 'x'; + *dst = '\0'; + sz--; + } + + for ( ; *dst != '\0' && sz; dst++, sz--) + /* Jump to end. */ ; for ( ; *src != '\0' && sz > 1; src++) { ssz = snprintf(dst, (size_t)sz, "%.2x", *src); -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv