diff options
Diffstat (limited to 'Build/source/texk/detex/TLPATCHES')
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/ChangeLog | 40 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/TL-Changes | 6 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/patch-01-ANSI-C | 228 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/patch-03-warnings | 124 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/patch-04-kpathsea | 158 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/patch-05-kern-and-glue | 35 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/patch-06-never-interactive | 9 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/patch-07-rename | 48 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/patch-08-kpathsea | 52 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/patch-09-binary | 28 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/patch-10-ANSI-strings | 52 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/patch-11-c_auto_h | 21 | ||||
-rw-r--r-- | Build/source/texk/detex/TLPATCHES/patch-12-typo | 12 |
13 files changed, 813 insertions, 0 deletions
diff --git a/Build/source/texk/detex/TLPATCHES/ChangeLog b/Build/source/texk/detex/TLPATCHES/ChangeLog new file mode 100644 index 00000000000..40a038a6f51 --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/ChangeLog @@ -0,0 +1,40 @@ +2014-08-20 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-12-typo (new): Fix a typo. + from Werner LEMBERG <wl@gnu.org>. + +2013-06-28 Peter Breitenlohner <peb@mppmu.mpg.de> + + patch-10-ANSI (new): Replace index() => strchr() and + rindex() => strrchr(). + patch-11-c_auto_h (new): First #include <c-auto.h>. + +2012-08-24 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-08-kpathsea (new): Use kpse_program_name. + * patch-09-binary (new): Use binary mode for output file. + +2012-08-02 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-07-rename (new): Rename ERROR -> my_ERROR to avoid a + conflict with WIN32 headers (from W32TeX). + +2012-06-21 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-06-never-interactive (new): Added the never-interactive + option to prevent flex from creating a problematic prototype for + isatty(). + +2011-06-07 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-05-kern-and-glue (new): Handle `\kern', allow `em/ex' + for dimensions, handle glue specs. + +2010-06-10 Peter Breitenlohner <peb@mppmu.mpg.de> + + Adapt to detex-2.8. + * patch-01-ANSI-C (new): ANSI C function declarations and + definitions, no nested declarations. + * patch-03-warnings (new): Avoid compiler warnings. + * patch-04-kpathsea (new): Use kpse_find_file(). + diff --git a/Build/source/texk/detex/TLPATCHES/TL-Changes b/Build/source/texk/detex/TLPATCHES/TL-Changes new file mode 100644 index 00000000000..bc7475d4644 --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/TL-Changes @@ -0,0 +1,6 @@ +Changes applied to the detex-2.8 tree as obtained from: + http://www.cs.purdue.edu/homes/trinkle/detex/ + +Renamed: + detex.1l -> detex.man + diff --git a/Build/source/texk/detex/TLPATCHES/patch-01-ANSI-C b/Build/source/texk/detex/TLPATCHES/patch-01-ANSI-C new file mode 100644 index 00000000000..22b9b553f9c --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/patch-01-ANSI-C @@ -0,0 +1,228 @@ +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2008-02-01 20:55:51.000000000 +0100 ++++ detex-2.8/detex.l 2010-06-11 23:12:06.648394135 +0200 +@@ -72,12 +72,26 @@ + #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2 + #define CITE(x) if (fLatex && !fCite) KILLARGS(x) + +-char *SafeMalloc(); ++void AddInclude(char *sbFile); ++void ErrorExit(char *sb1); ++void IncludeFile(char *sbFile); ++void InputFile(char *sbFile); ++void SetEnvIgnore(char *sbEnvList); ++void SetInputPaths(void); ++void Warning(char *sb1, char *sb2); ++int BeginEnv(char *sbEnv); ++int EndEnv(char *sbEnv); ++int InList(char *sbFile); ++int SeparateList(char *sbList, char *rgsbList[] ,char chSep, int csbMax); ++FILE *TexOpen(char *sbFile); ++char *SafeMalloc(int cch, char *sbMessage); ++char *getenv(); + #ifndef NO_MALLOC_DECL + char *malloc(); + #endif + #ifdef OS2 + void yyless(int); ++void OS2UsageExit(void); + #endif + + char *rgsbEnvIgnore[MAXENVS]; /* list of environments ignored */ +@@ -368,12 +382,10 @@ + ** If no input files are specified on the command line, process stdin. + ******/ + +-main(cArgs,rgsbArgs) +-int cArgs; +-char *rgsbArgs[]; ++int ++main(int cArgs, char *rgsbArgs[]) + { + char *pch, *sbEnvList = DEFAULTENV, sbBadOpt[2]; +- FILE *TexOpen(); + int fSawFile = 0, iArgs = 1; + + /* get base name and decide what we are doing, detex or delatex */ +@@ -477,7 +489,8 @@ + ** return the termination signal for lex. + ******/ + +-yywrap() ++int ++yywrap(void) + { + (void)fclose(yyin); + #ifdef FLEX_SCANNER +@@ -501,8 +514,8 @@ + ** a yyless routine + ******/ + +-void yyless(n) +-int n; ++void ++yyless(int n) + { + int i = strlen(yytext); + +@@ -516,8 +529,8 @@ + ** sbEnvList. + ******/ + +-SetEnvIgnore(sbEnvList) +-char *sbEnvList; ++void ++SetEnvIgnore(char *sbEnvList) + { + char *sb; + +@@ -533,8 +546,8 @@ + ** is, sbCurrentEnv is set to sbEnv. + ******/ + +-BeginEnv(sbEnv) +-char *sbEnv; ++int ++BeginEnv(char *sbEnv) + { + int i; + +@@ -551,8 +564,8 @@ + ** EndEnv -- checks to see if sbEnv is the current environment being ignored. + ******/ + +-EndEnv(sbEnv) +-char *sbEnv; ++int ++EndEnv(char *sbEnv) + { + if (!fLatex) return(0); + if (strcmp(sbEnv, sbCurrentEnv) == 0) +@@ -565,11 +578,9 @@ + ** the sbFile is ignored. + ******/ + +-InputFile(sbFile) +-char *sbFile; ++void ++InputFile(char *sbFile) + { +- FILE *TexOpen(); +- + if (!fFollow) + return; + rgfp[cfp++] = yyin; +@@ -589,11 +600,9 @@ + ** and open sbFile. If the open fails, the sbFile is ignored. + ******/ + +-IncludeFile(sbFile) +-char *sbFile; ++void ++IncludeFile(char *sbFile) + { +- FILE *TexOpen(); +- + if (!fFollow) + return; + if (!InList(sbFile)) +@@ -615,8 +624,8 @@ + ** If the include list is too long, sbFile is ignored. + ******/ + +-AddInclude(sbFile) +-char *sbFile; ++void ++AddInclude(char *sbFile) + { + if (!fFollow) + return; +@@ -631,8 +640,8 @@ + ** no list, all files are assumed to be "in the list". + ******/ + +-InList(sbFile) +-char *sbFile; ++int ++InList(char *sbFile) + { + char *pch, sbBase[MAXPATHLEN]; + int i; +@@ -658,9 +667,10 @@ + ** routine does not honor the '//' construct (expand subdirs). + ******/ + +-SetInputPaths() ++void ++SetInputPaths(void) + { +- char *sb, *sbPaths, *getenv(); ++ char *sb, *sbPaths; + int cchDefaults, cchPaths; + + cchDefaults = strlen(DEFAULTINPUTS); +@@ -698,9 +708,8 @@ + ** ERROR is returned if there are more than csbMax words. + ******/ + +-SeparateList(sbList, rgsbList, chSep, csbMax) +-char *sbList, *rgsbList[], chSep; +-int csbMax; ++int ++SeparateList(char *sbList, char *rgsbList[], char chSep, int csbMax) + { + int csbList = 0; + +@@ -725,8 +734,7 @@ + ******/ + + FILE * +-TexOpen(sbFile) +-char *sbFile; ++TexOpen(char *sbFile) + { + char *pch, *sbNew; + FILE *fp; +@@ -784,9 +792,7 @@ + ******/ + + char * +-SafeMalloc(cch, sbMessage) +-int cch; +-char *sbMessage; ++SafeMalloc(int cch, char *sbMessage) + { + char *sb; + +@@ -799,8 +805,8 @@ + ** Warning -- print a warning message preceded by the program name. + ******/ + +-Warning(sb1, sb2) +-char *sb1, *sb2; ++void ++Warning(char *sb1, char *sb2) + { + (void)fprintf(stderr, "%s: warning: %s %s\n", sbProgName, sb1, sb2); + } +@@ -810,8 +816,8 @@ + ** Stdout is flushed and detex exits. + ******/ + +-ErrorExit(sb1) +-char *sb1; ++void ++ErrorExit(char *sb1) + { + (void)fflush(stdout); + (void)fprintf(stderr, "%s: error: %s\n", sbProgName, sb1); +@@ -823,7 +829,8 @@ + ** OS2UsageExit -- print OS/2 usage message and exit. + ******/ + +-OS2UsageExit() ++void ++OS2UsageExit(void) + { + (void)printf("\n%s [ -clnstw ] [ -e environment-list ] [ filename[.tex] ... ]\n", + sbProgName); diff --git a/Build/source/texk/detex/TLPATCHES/patch-03-warnings b/Build/source/texk/detex/TLPATCHES/patch-03-warnings new file mode 100644 index 00000000000..d3a9f93eab5 --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/patch-03-warnings @@ -0,0 +1,124 @@ +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2010-06-11 23:12:06.000000000 +0200 ++++ detex-2.8/detex.l 2010-06-11 23:26:08.554783186 +0200 +@@ -73,18 +73,18 @@ + #define CITE(x) if (fLatex && !fCite) KILLARGS(x) + + void AddInclude(char *sbFile); +-void ErrorExit(char *sb1); ++void ErrorExit(const char *sb1); + void IncludeFile(char *sbFile); + void InputFile(char *sbFile); +-void SetEnvIgnore(char *sbEnvList); ++void SetEnvIgnore(const char *sbEnvList); + void SetInputPaths(void); +-void Warning(char *sb1, char *sb2); +-int BeginEnv(char *sbEnv); +-int EndEnv(char *sbEnv); ++void Warning(const char *sb1, const char *sb2); ++int BeginEnv(const char *sbEnv); ++int EndEnv(const char *sbEnv); + int InList(char *sbFile); + int SeparateList(char *sbList, char *rgsbList[] ,char chSep, int csbMax); + FILE *TexOpen(char *sbFile); +-char *SafeMalloc(int cch, char *sbMessage); ++char *SafeMalloc(int cch, const char *sbMessage); + char *getenv(); + #ifndef NO_MALLOC_DECL + char *malloc(); +@@ -385,7 +385,8 @@ + int + main(int cArgs, char *rgsbArgs[]) + { +- char *pch, *sbEnvList = DEFAULTENV, sbBadOpt[2]; ++ char *pch, sbBadOpt[2]; ++ const char *sbEnvList = DEFAULTENV; + int fSawFile = 0, iArgs = 1; + + /* get base name and decide what we are doing, detex or delatex */ +@@ -530,7 +531,7 @@ + ******/ + + void +-SetEnvIgnore(char *sbEnvList) ++SetEnvIgnore(const char *sbEnvList) + { + char *sb; + +@@ -547,7 +548,7 @@ + ******/ + + int +-BeginEnv(char *sbEnv) ++BeginEnv(const char *sbEnv) + { + int i; + +@@ -565,7 +566,7 @@ + ******/ + + int +-EndEnv(char *sbEnv) ++EndEnv(const char *sbEnv) + { + if (!fLatex) return(0); + if (strcmp(sbEnv, sbCurrentEnv) == 0) +@@ -670,7 +671,8 @@ + void + SetInputPaths(void) + { +- char *sb, *sbPaths; ++ const char *sb; ++ char *sbPaths; + int cchDefaults, cchPaths; + + cchDefaults = strlen(DEFAULTINPUTS); +@@ -715,7 +717,7 @@ + + while (sbList && *sbList && csbList < csbMax) { + rgsbList[csbList++] = sbList; +- if (sbList = index(sbList, chSep)) ++ if ((sbList = index(sbList, chSep))) + *sbList++ = '\0'; + } + return(sbList && *sbList ? ERROR : csbList); +@@ -760,10 +762,12 @@ + /* If sbFile ends in .tex then it must be there */ + if ((pch = rindex(sbFullPath, '.')) != NULL + && (strcmp(pch, ".tex") == 0)) ++ { + if ((fp = fopen(sbFullPath, "r")) != NULL) + return(fp); + else + continue; ++ } + + /* if .<ext> then try to open it. the '.' represents */ + /* the beginning of an extension if it is not the first */ +@@ -792,7 +796,7 @@ + ******/ + + char * +-SafeMalloc(int cch, char *sbMessage) ++SafeMalloc(int cch, const char *sbMessage) + { + char *sb; + +@@ -806,7 +810,7 @@ + ******/ + + void +-Warning(char *sb1, char *sb2) ++Warning(const char *sb1, const char *sb2) + { + (void)fprintf(stderr, "%s: warning: %s %s\n", sbProgName, sb1, sb2); + } +@@ -817,7 +821,7 @@ + ******/ + + void +-ErrorExit(char *sb1) ++ErrorExit(const char *sb1) + { + (void)fflush(stdout); + (void)fprintf(stderr, "%s: error: %s\n", sbProgName, sb1); diff --git a/Build/source/texk/detex/TLPATCHES/patch-04-kpathsea b/Build/source/texk/detex/TLPATCHES/patch-04-kpathsea new file mode 100644 index 00000000000..f30d6f81d12 --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/patch-04-kpathsea @@ -0,0 +1,158 @@ +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2010-06-11 23:26:08.000000000 +0200 ++++ detex-2.8/detex.l 2010-06-12 00:15:05.785339097 +0200 +@@ -49,6 +49,23 @@ + */ + + #include "detex.h" ++ ++#ifdef KPATHSEA ++ ++#include <c-auto.h> ++#include <kpathsea/c-auto.h> ++#include <kpathsea/config.h> ++#include <kpathsea/c-memstr.h> ++#include <kpathsea/c-pathmx.h> ++#include <kpathsea/c-std.h> ++#include <kpathsea/tex-file.h> ++ ++#ifdef HAVE_SYS_PARAM_H ++#include <sys/param.h> ++#endif ++ ++#else /* KPATHSEA */ ++ + #ifdef HAVE_STRING_H + #include <string.h> + #define index strchr +@@ -59,10 +76,15 @@ + #ifndef MAXPATHLEN + #include <sys/param.h> + #endif ++#define PATH_MAX MAXPATHLEN + #ifdef OS2 + #include <stdlib.h> + #endif + ++#endif /* KPATHSEA */ ++ ++#undef IGNORE ++ + #define LaBEGIN if (fLatex) BEGIN + #define IGNORE if (fSpace && !fWord) putchar(' ') + #define SPACE if (!fWord) putchar(' ') +@@ -77,7 +99,9 @@ + void IncludeFile(char *sbFile); + void InputFile(char *sbFile); + void SetEnvIgnore(const char *sbEnvList); ++#ifndef KPATHSEA + void SetInputPaths(void); ++#endif + void Warning(const char *sb1, const char *sb2); + int BeginEnv(const char *sbEnv); + int EndEnv(const char *sbEnv); +@@ -85,6 +109,7 @@ + int SeparateList(char *sbList, char *rgsbList[] ,char chSep, int csbMax); + FILE *TexOpen(char *sbFile); + char *SafeMalloc(int cch, const char *sbMessage); ++#ifndef KPATHSEA + char *getenv(); + #ifndef NO_MALLOC_DECL + char *malloc(); +@@ -93,12 +118,16 @@ + void yyless(int); + void OS2UsageExit(void); + #endif ++#endif /* KPATHSEA */ + + char *rgsbEnvIgnore[MAXENVS]; /* list of environments ignored */ + char *rgsbIncList[MAXINCLIST]; /* list of includeonly files */ + char *rgsbInputPaths[MAXINPUTPATHS]; /* list of input paths in order */ + char sbCurrentEnv[CCHMAXENV]; /* current environment being ignored */ + char *sbProgName; /* name we were invoked with */ ++#ifndef NOFILE /* might be defined in <sys/param.h> */ ++#define NOFILE 256 ++#endif + FILE *rgfp[NOFILE+1]; /* stack of input/include files */ + int cfp = 0; /* count of files in stack */ + int cOpenBrace = 0; /* count of `{' in <LaMacro> and <LaMacro2> */ +@@ -400,6 +429,9 @@ + _splitpath (rgsbArgs[0], drive, dir, fname, ext); + sbProgName = strlwr(fname); + #else ++#ifdef KPATHSEA ++ kpse_set_program_name (rgsbArgs[0], NULL); ++#endif + if ((sbProgName = rindex(rgsbArgs[0], '/')) != NULL) + sbProgName++; + else +@@ -407,9 +439,11 @@ + #endif + if (strcmp("delatex",sbProgName) == 0) + fLatex = 1; +- ++ ++#ifndef KPATHSEA + /* set rgsbInputPaths for use with TexOpen() */ + SetInputPaths(); ++#endif + + /* process command line options */ + while (iArgs < cArgs && *(pch = rgsbArgs[iArgs]) == CHOPT) { +@@ -644,7 +678,7 @@ + int + InList(char *sbFile) + { +- char *pch, sbBase[MAXPATHLEN]; ++ char *pch, sbBase[PATH_MAX]; + int i; + + if (csbIncList == 0) /* no list */ +@@ -659,6 +693,7 @@ + return(0); + } + ++#ifndef KPATHSEA + /****** + ** SetInputPaths -- sets rgsbInputPaths to the values indicated by the + ** TEXINPUTS environment variable if set or else DEFAULTINPUTS. If +@@ -702,6 +737,7 @@ + ErrorExit("TEXINPUTS environment variable has too many paths"); + #endif + } ++#endif + + /****** + ** SeparateList -- takes a chSep separated list sbList, replaces the +@@ -738,10 +774,12 @@ + FILE * + TexOpen(char *sbFile) + { +- char *pch, *sbNew; ++ char *sbNew; ++#ifndef KPATHSEA ++ char *pch; + FILE *fp; + int iPath; +- static char sbFullPath[MAXPATHLEN]; ++ static char sbFullPath[PATH_MAX]; + + for (iPath = 0; iPath < csbInputPaths; iPath++) { + #ifdef OS2 +@@ -788,7 +826,15 @@ + if ((fp = fopen(sbFullPath, "r")) != NULL) + return(fp); + } +- return((FILE *)NULL); ++ return NULL; ++#else ++ sbNew = kpse_find_file (sbFile, kpse_tex_format, false); ++ ++ if (sbNew == NULL) ++ return NULL; ++ ++ return fopen (sbNew, "r"); ++#endif + } + + /****** diff --git a/Build/source/texk/detex/TLPATCHES/patch-05-kern-and-glue b/Build/source/texk/detex/TLPATCHES/patch-05-kern-and-glue new file mode 100644 index 00000000000..784ef2ff5a7 --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/patch-05-kern-and-glue @@ -0,0 +1,35 @@ +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2010-06-12 00:15:05.000000000 +0200 ++++ detex-2.8/detex.l 2011-06-07 13:42:05.000000000 +0200 +@@ -157,7 +157,12 @@ + W [a-zA-Z]+ + N [+-]?(([0-9]+(\.[0-9]+)?)|(\.[0-9]+)) + U pt|pc|in|bp|cm|mm|dd|cc|sp +-D {S}(({N}{S}{U})|(\\{W})){S} ++HU {U}|em ++HD {S}(({N}{S}{HU})|(\\{W})){S} ++HG {HD}(plus{HD})?(minus{HD})? ++VU {U}|ex ++VD {S}(({N}{S}{VU})|(\\{W})){S} ++VG {VD}(plus{VD})?(minus{VD})? + Z \*? + + %Start Define Display IncludeOnly Input Math Normal Control +@@ -212,11 +217,12 @@ + <LaEnd>"\n" NEWLINE; + <LaEnd>. ; + +-<Normal>"\\vskip"{D} ; +-<Normal>"\\vspace"{Z}{S}"{"{D}"}" ; +-<Normal>"\\hskip"{D} ; +-<Normal>"\\hspace"{Z}{S}"{"{D}"}" ; +-<Normal>"\\addvspace"{S}"{"{D}"}" ; ++<Normal>"\\kern"{HD} ; ++<Normal>"\\vskip"{VG} ; ++<Normal>"\\vspace"{Z}{S}"{"{VG}"}" ; ++<Normal>"\\hskip"{HG} ; ++<Normal>"\\hspace"{Z}{S}"{"{HG}"}" ; ++<Normal>"\\addvspace"{S}"{"{VG}"}" ; + + <Normal>"\\newlength" { KILLARGS(1); } + <Normal>"\\setlength" { KILLARGS(2); } diff --git a/Build/source/texk/detex/TLPATCHES/patch-06-never-interactive b/Build/source/texk/detex/TLPATCHES/patch-06-never-interactive new file mode 100644 index 00000000000..9db44ace3ed --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/patch-06-never-interactive @@ -0,0 +1,9 @@ +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2011-06-07 13:42:05.000000000 +0200 ++++ detex-2.8/detex.l 2012-06-21 11:52:31.000000000 +0200 +@@ -1,3 +1,5 @@ ++%option never-interactive ++ + %{ + #ifndef lint + static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/03/01 20:22:01 trinkle Exp trinkle $"; diff --git a/Build/source/texk/detex/TLPATCHES/patch-07-rename b/Build/source/texk/detex/TLPATCHES/patch-07-rename new file mode 100644 index 00000000000..4f8c1452d2a --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/patch-07-rename @@ -0,0 +1,48 @@ +diff -ur detex-2.8.orig/detex.h detex-2.8/detex.h +--- detex-2.8.orig/detex.h 2008-02-01 20:55:51.000000000 +0100 ++++ detex-2.8/detex.h 2012-08-02 10:31:17.000000000 +0200 +@@ -78,4 +78,4 @@ + #define CHTEXOPT 't' + #define CHWORDOPT 'w' + +-#define ERROR -1 ++#define my_ERROR -1 +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2012-06-21 11:52:31.000000000 +0200 ++++ detex-2.8/detex.l 2012-08-02 10:31:20.000000000 +0200 +@@ -580,7 +580,7 @@ + sb = SafeMalloc(strlen(sbEnvList) + 1, "malloc for SetEnvIgnore failed"); + (void) strcpy(sb, sbEnvList); + csbEnvIgnore = SeparateList(sb, rgsbEnvIgnore, CHENVSEP, MAXENVS); +- if (csbEnvIgnore == ERROR) ++ if (csbEnvIgnore == my_ERROR) + ErrorExit("The environtment list contains too many environments"); + } + +@@ -738,7 +738,7 @@ + (void)strcat(sbPaths, DEFAULTINPUTS); + + csbInputPaths = SeparateList(sbPaths, rgsbInputPaths, CHPATHSEP, MAXINPUTPATHS); +- if (csbInputPaths == ERROR) ++ if (csbInputPaths == my_ERROR) + #ifdef OS2 + ErrorExit("TEXINPUT(S) environment variable has too many paths"); + #else +@@ -751,7 +751,7 @@ + ** SeparateList -- takes a chSep separated list sbList, replaces the + ** chSep's with NULLs and sets rgsbList[i] to the beginning of + ** the ith word in sbList. The number of words is returned. A +-** ERROR is returned if there are more than csbMax words. ++** my_ERROR is returned if there are more than csbMax words. + ******/ + + int +@@ -764,7 +764,7 @@ + if ((sbList = index(sbList, chSep))) + *sbList++ = '\0'; + } +- return(sbList && *sbList ? ERROR : csbList); ++ return(sbList && *sbList ? my_ERROR : csbList); + } + + /****** diff --git a/Build/source/texk/detex/TLPATCHES/patch-08-kpathsea b/Build/source/texk/detex/TLPATCHES/patch-08-kpathsea new file mode 100644 index 00000000000..2eacbf68bcc --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/patch-08-kpathsea @@ -0,0 +1,52 @@ + Clarify that DEFAULTINPUTS and CHPATHSEP are not used with KPATHSEA + +diff -ur detex-2.8.orig/detex.h detex-2.8/detex.h +--- detex-2.8.orig/detex.h 2012-08-02 10:31:17.000000000 +0200 ++++ detex-2.8/detex.h 2012-08-24 10:23:29.000000000 +0200 +@@ -51,6 +51,7 @@ + + #define MAXINCLIST 40 + ++#ifndef KPATHSEA + #ifdef OS2 + #define DEFAULTINPUTS ".;/emtex/texinput" + #define CHPATHSEP ';' +@@ -58,6 +59,8 @@ + #define DEFAULTINPUTS ".:/usr/local/tex/inputs" + #define CHPATHSEP ':' + #endif ++#endif ++ + #define MAXINPUTPATHS 10 + + #define DEFAULTENV "array,eqnarray,equation,figure,mathmatica,picture,table,verbatim" + + With KPATHSEA use kpse_program_name. + Fixed a typo. + +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2012-08-02 10:31:20.000000000 +0200 ++++ detex-2.8/detex.l 2012-08-24 10:37:03.000000000 +0200 +@@ -436,10 +436,10 @@ + #endif + _splitpath (rgsbArgs[0], drive, dir, fname, ext); + sbProgName = strlwr(fname); +-#else +-#ifdef KPATHSEA ++#elif defined(KPATHSEA) + kpse_set_program_name (rgsbArgs[0], NULL); +-#endif ++ sbProgName = kpse_program_name; ++#else + if ((sbProgName = rindex(rgsbArgs[0], '/')) != NULL) + sbProgName++; + else +@@ -462,7 +467,7 @@ + break; + case CHENVOPT: + if (++iArgs >= cArgs) { +- ErrorExit("-e option requires and argument"); ++ ErrorExit("-e option requires an argument"); + } + sbEnvList = rgsbArgs[iArgs]; + break; diff --git a/Build/source/texk/detex/TLPATCHES/patch-09-binary b/Build/source/texk/detex/TLPATCHES/patch-09-binary new file mode 100644 index 00000000000..95d272030ad --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/patch-09-binary @@ -0,0 +1,28 @@ + In TeX Live we use binary mode for all output files. + +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2012-08-24 10:37:03.000000000 +0200 ++++ detex-2.8/detex.l 2012-08-24 10:51:12.000000000 +0200 +@@ -83,6 +83,11 @@ + #include <stdlib.h> + #endif + ++#ifdef WIN32 ++#include <fcntl.h> ++#include <io.h> ++#endif ++ + #endif /* KPATHSEA */ + + #undef IGNORE +@@ -494,6 +499,10 @@ + } + SetEnvIgnore(sbEnvList); + ++#ifdef WIN32 ++ _setmode(fileno(stdout), _O_BINARY); ++#endif ++ + /* process input files */ + for (; iArgs < cArgs; iArgs++) { + fSawFile++; diff --git a/Build/source/texk/detex/TLPATCHES/patch-10-ANSI-strings b/Build/source/texk/detex/TLPATCHES/patch-10-ANSI-strings new file mode 100644 index 00000000000..8f03d7b26af --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/patch-10-ANSI-strings @@ -0,0 +1,52 @@ +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2012-08-24 10:51:12.000000000 +0200 ++++ detex-2.8/detex.l 2013-06-27 18:49:05.000000000 +0200 +@@ -70,10 +70,10 @@ + + #ifdef HAVE_STRING_H + #include <string.h> +-#define index strchr +-#define rindex strrchr + #else + #include <strings.h> ++#define strchr index ++#define strrchr rindex + #endif + #ifndef MAXPATHLEN + #include <sys/param.h> +@@ -445,7 +445,7 @@ + kpse_set_program_name (rgsbArgs[0], NULL); + sbProgName = kpse_program_name; + #else +- if ((sbProgName = rindex(rgsbArgs[0], '/')) != NULL) ++ if ((sbProgName = strrchr(rgsbArgs[0], '/')) != NULL) + sbProgName++; + else + sbProgName = rgsbArgs[0]; +@@ -701,7 +701,7 @@ + if (csbIncList == 0) /* no list */ + return(1); + (void)strcpy(sbBase, sbFile); +- if ((pch = rindex(sbBase, '.')) != NULL) ++ if ((pch = strrchr(sbBase, '.')) != NULL) + *pch = '\0'; + i = 0; + while ((i < csbIncList) && rgsbIncList[i]) +@@ -770,7 +770,7 @@ + + while (sbList && *sbList && csbList < csbMax) { + rgsbList[csbList++] = sbList; +- if ((sbList = index(sbList, chSep))) ++ if ((sbList = strchr(sbList, chSep))) + *sbList++ = '\0'; + } + return(sbList && *sbList ? my_ERROR : csbList); +@@ -815,7 +815,7 @@ + #endif + + /* If sbFile ends in .tex then it must be there */ +- if ((pch = rindex(sbFullPath, '.')) != NULL ++ if ((pch = strrchr(sbFullPath, '.')) != NULL + && (strcmp(pch, ".tex") == 0)) + { + if ((fp = fopen(sbFullPath, "r")) != NULL) diff --git a/Build/source/texk/detex/TLPATCHES/patch-11-c_auto_h b/Build/source/texk/detex/TLPATCHES/patch-11-c_auto_h new file mode 100644 index 00000000000..e88dad2ad37 --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/patch-11-c_auto_h @@ -0,0 +1,21 @@ +diff -ur -x detex.c detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2013-06-27 18:49:05.000000000 +0200 ++++ detex-2.8/detex.l 2013-06-28 14:46:12.000000000 +0200 +@@ -1,6 +1,6 @@ + %option never-interactive + +-%{ ++%top{ + #ifndef lint + static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/03/01 20:22:01 trinkle Exp trinkle $"; + #endif +@@ -89,7 +89,9 @@ + #endif + + #endif /* KPATHSEA */ ++} + ++%{ + #undef IGNORE + + #define LaBEGIN if (fLatex) BEGIN diff --git a/Build/source/texk/detex/TLPATCHES/patch-12-typo b/Build/source/texk/detex/TLPATCHES/patch-12-typo new file mode 100644 index 00000000000..77087a7ccaa --- /dev/null +++ b/Build/source/texk/detex/TLPATCHES/patch-12-typo @@ -0,0 +1,12 @@ +diff -ur -x detex.c detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2013-06-28 14:46:12.000000000 +0200 ++++ detex-2.8/detex.l 2014-08-20 09:56:40.115740053 +0200 +@@ -592,7 +592,7 @@ + (void) strcpy(sb, sbEnvList); + csbEnvIgnore = SeparateList(sb, rgsbEnvIgnore, CHENVSEP, MAXENVS); + if (csbEnvIgnore == my_ERROR) +- ErrorExit("The environtment list contains too many environments"); ++ ErrorExit("The environment list contains too many environments"); + } + + /****** |