diff options
Diffstat (limited to 'Build/source/texk/detex/TLpatches/patch-04-kpathsea')
-rw-r--r-- | Build/source/texk/detex/TLpatches/patch-04-kpathsea | 155 |
1 files changed, 4 insertions, 151 deletions
diff --git a/Build/source/texk/detex/TLpatches/patch-04-kpathsea b/Build/source/texk/detex/TLpatches/patch-04-kpathsea index f30d6f81d12..d0e3f52364a 100644 --- a/Build/source/texk/detex/TLpatches/patch-04-kpathsea +++ b/Build/source/texk/detex/TLpatches/patch-04-kpathsea @@ -1,31 +1,7 @@ -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 @@ +diff -ur opendetex-2.8.3.orig/detex.l opendetex-2.8.3/detex.l +--- opendetex-2.8.3.orig/detex.l 2018-02-11 18:42:05.000000000 +0900 ++++ opendetex-2.8.3/detex.l 2018-06-20 23:12:37.000000000 +0900 +@@ -73,6 +73,7 @@ #ifndef MAXPATHLEN #include <sys/param.h> #endif @@ -33,126 +9,3 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l #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 - } - - /****** |