source: trunk/dports/tex/texlive-bin/files/patch-svn31621-mendex.diff @ 111792

Last change on this file since 111792 was 111792, checked in by dports@…, 6 years ago

texlive-bin: backport various fixes from upstream (see #39334, and
http://www.tug.org/pipermail/tldistro/2013q3/000218.html)

File size: 2.0 KB
  • texk/mendexk/Makefile.am

    upstream svn31621 fix for mendex
    ---
     texk/mendexk/ChangeLog         |    9 +++++++++
     texk/mendexk/Makefile.am       |    9 +++++++++
     texk/mendexk/fwrite.c          |    4 ++--
     texk/mendexk/tests/foo.idx     |    3 +++
     texk/mendexk/tests/foo.ind     |    5 +++++
     texk/mendexk/tests/mendex.test |   16 ++++++++++++++++
     6 files changed, 44 insertions(+), 2 deletions(-)
    
     
    5050        indexsty \
    5151        mendex.doc
    5252
     53## Tests
     54##
     55TESTS = tests/mendex.test
     56EXTRA_DIST += $(TESTS)
     57
     58## tests/mendex.test
     59EXTRA_DIST += tests/foo.idx tests/foo.ind
     60DISTCLEANFILES = foo.*
     61
  • texk/mendexk/fwrite.c

     
    1515static void linecheck(char *lbuff, char *tmpbuff);
    1616static void crcheck(char *lbuff, FILE *fp);
    1717
    18 #define TAIL(x) (x+strlen(x))
     18#define TAIL(x) ((x)+strlen(x))
    1919
    2020/* if we don't have vsnprintf() */
    2121/* #define vsnprintf(buff,len,format,argptr) vsprintf(buff,format,argptr) */
     
    385385                                        }
    386386                                        if (strlen(ind.p[j].enc)>0) {
    387387                                                sprintf(tmpbuff,"%s%s%s",encap_prefix,ind.p[j].enc,encap_infix);
    388                                                 sprintf(tmpbuff,"%s%s%s",ind.p[j].page,encap_suffix,delim_n);
     388                                                sprintf(TAIL(tmpbuff),"%s%s%s",ind.p[j].page,encap_suffix,delim_n);
    389389                                                linecheck(lbuff,tmpbuff);
    390390                                        }
    391391                                }
  • new file texk/mendexk/tests/foo.idx

    - +  
     1\indexentry{foo|(}{1}
     2\indexentry{foo|mac}{1}
     3\indexentry{foo|)}{1}
  • new file texk/mendexk/tests/foo.ind

    - +  
     1\begin{theindex}
     2
     3  \item foo, \mac{1}, 1
     4
     5\end{theindex}
  • new file texk/mendexk/tests/mendex.test

    - +  
     1#! /bin/sh
     2
     3# Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org>
     4# You may freely use, modify and/or distribute this file.
     5
     6TEXMFCNF=$srcdir/../kpathsea
     7export TEXMFCNF
     8
     9rm -f foo.*
     10
     11./mendex $srcdir/tests/foo.idx -o foo.ind1 -t foo.ilg1 \
     12        && diff $srcdir/tests/foo.ind foo.ind1 || exit 1
     13
     14cat $srcdir/tests/foo.idx | ./mendex >foo.ind2 2>foo.ilg2 \
     15        && diff $srcdir/tests/foo.ind foo.ind2 || exit 1
     16
Note: See TracBrowser for help on using the repository browser.