pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
textproc/mendexk bug report
Hi, I'm reading ptex mailing list and following bug is
reported. Would you commit this ?
Thanks a lot,
---
Makoto Fujiwara,
Chiba, Japan, Narita Airport and Disneyland prefecture.
Index: textproc/mendexk/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/textproc/mendexk/distinfo,v
retrieving revision 1.2
diff -u -r1.2 distinfo
--- textproc/mendexk/distinfo 3 Mar 2012 22:13:39 -0000 1.2
+++ textproc/mendexk/distinfo 7 Sep 2013 14:10:04 -0000
@@ -3,3 +3,4 @@
SHA1 (texlive-20110705-source.tar.xz) =
7a47cfe847801c86c98da8ade181baf97339f6e4
RMD160 (texlive-20110705-source.tar.xz) =
fbcad494cc4717a0238ab2624f259270fce9332b
Size (texlive-20110705-source.tar.xz) = 131207904 bytes
+SHA1 (patch-texk_mendex_fwrite.c) = eae86a2a8af6d79b0a1ce12cb7430914fbe6dbca
Index: textproc/mendexk/patches/patch-texk_mendex_fwrite.c
===================================================================
RCS file: textproc/mendexk/patches/patch-texk_mendex_fwrite.c
diff -N textproc/mendexk/patches/patch-texk_mendex_fwrite.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ textproc/mendexk/patches/patch-texk_mendex_fwrite.c 7 Sep 2013 14:10:04
-0000
@@ -0,0 +1,78 @@
+$NetBSD$
+
+Dear all,
+
+I hope there is still someone listening.
+
+Since quite some time there is a bug in mendex.
+See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=534641
+
+Easy to reproduce:
+
+With the following idx file:
+ \indexentry{foo|(}{1}
+ \indexentry{foo|mac}{1}
+ \indexentry{foo|)}{1}
+mendex produces
+ ...
+ \item foo, 1}, 1
+ ...
+instead of
+ ...
+ \item foo, \mac{1}, 1
+ ...
+
+I looked through the current sources in TeX Live and found that
+in fwrite.c, function range_check:
+ if (strlen(ind.p[j].enc)>0) {
+ sprintf(tmpbuff,"%s%s%s",encap_prefix,ind.p[j].enc,encap_infix);
+ sprintf(tmpbuff,"%s%s%s",ind.p[j].page,encap_suffix,delim_n);
+ linecheck(lbuff,tmpbuff);
+ }
+that looks suspicious. The tmpbuff is overwritten on the second
+incantation, and in fact the
+ encap_prefix (which is \)
+ ind.p[j].enc (which is the macro name)
+ encap_infix (which is {)
+are missing from the output.
+
+So my guess is that the correct version would be to have
+
sprintf(tmpbuff,"%s%s%s%s%s%s",encap_prefix,ind.p[j].enc,encap_infix,ind.p[j].page,encap_suffix,delim_n);
+instead.
+
+And indeed, with that change the output is as expected.
+
+Checking the differences I see that the *reverse change* was introduced
+between 2.6c and 2.6d. So till 2.6c the above line was there.
+
+I am not sure who is currently maintaining mendex, but I would
+suggest to fix it as lined out above.I attach a patch against
+current TeX Live sources (as far as I see).
+
+
+Norbert
+------------------------------------------------------------------------
+ ChangeLog
+ +2013-09-07 Norbert Preining <preining%logic.at@localhost>
+ +
+ + * fwrite.c: fix missing output when range operators are
+ + used with macro definitions
+ +
+ 2012-11-19 Peter Breitenlohner <peb%mppmu.mpg.de@localhost>
+
+ * Makefile.am: Avoid use of deprecated INCLUDES.
+--- fwrite.c
++++ fwrite.c
+@@ -384,8 +384,7 @@ static int range_check(struct index ind, int count, char
*lbuff)
+ ind.p[j].enc++;
+ }
+ if (strlen(ind.p[j].enc)>0) {
+-
sprintf(tmpbuff,"%s%s%s",encap_prefix,ind.p[j].enc,encap_infix);
+-
sprintf(tmpbuff,"%s%s%s",ind.p[j].page,encap_suffix,delim_n);
++
sprintf(tmpbuff,"%s%s%s%s%s%s",encap_prefix,ind.p[j].enc,encap_infix,ind.p[j].page,encap_suffix,delim_n);
+ linecheck(lbuff,tmpbuff);
+ }
+ }
+
+--LQksG6bCIzRHxTLp--
+
Home |
Main Index |
Thread Index |
Old Index