summaryrefslogtreecommitdiff
path: root/Build/source/texk/detex/detex-2.8-PATCHES
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-06-12 14:17:04 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-06-12 14:17:04 +0000
commit75aa2967ffe88d15a692c589b75edc3f8fae5c25 (patch)
tree4db0b8709049c4d0ab3451b99fadc8461c4cd341 /Build/source/texk/detex/detex-2.8-PATCHES
parent19794b65842cb439b28d895fad7b65d410583202 (diff)
detex 2.8 finished
git-svn-id: svn://tug.org/texlive/trunk@18912 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/detex/detex-2.8-PATCHES')
-rw-r--r--Build/source/texk/detex/detex-2.8-PATCHES/ChangeLog8
-rw-r--r--Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C84
-rw-r--r--Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const116
-rw-r--r--Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings110
-rw-r--r--Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea145
5 files changed, 221 insertions, 242 deletions
diff --git a/Build/source/texk/detex/detex-2.8-PATCHES/ChangeLog b/Build/source/texk/detex/detex-2.8-PATCHES/ChangeLog
new file mode 100644
index 00000000000..be1be4dd05d
--- /dev/null
+++ b/Build/source/texk/detex/detex-2.8-PATCHES/ChangeLog
@@ -0,0 +1,8 @@
+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/detex-2.8-PATCHES/patch-01-ANSI-C b/Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C
index 15dadd020dd..22b9b553f9c 100644
--- a/Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C
+++ b/Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C
@@ -1,38 +1,35 @@
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-09 13:34:01.456409201 +0200
-@@ -63,6 +63,21 @@
- #include <stdlib.h>
- #endif
++++ 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)
-+#undef IGNORE
-+
-+int BeginEnv(char *sbEnv);
-+int EndEnv(char *sbEnv);
-+void InputFile(char *sbFile);
-+void IncludeFile(char *sbFile);
+-char *SafeMalloc();
+void AddInclude(char *sbFile);
-+void SetInputPaths(void);
++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);
-+void ErrorExit(char *sb1);
-+int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax);
++int BeginEnv(char *sbEnv);
++int EndEnv(char *sbEnv);
+int InList(char *sbFile);
-+FILE * TexOpen(char *sbFile);
-+
- #define LaBEGIN if (fLatex) BEGIN
- #define IGNORE if (fSpace && !fWord) putchar(' ')
- #define SPACE if (!fWord) putchar(' ')
-@@ -72,7 +87,7 @@
- #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2
- #define CITE(x) if (fLatex && !fCite) KILLARGS(x)
-
--char *SafeMalloc();
-+char *SafeMalloc(int cch, char *sbMessage);
++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
-@@ -368,12 +383,10 @@
+ #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.
******/
@@ -47,7 +44,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
int fSawFile = 0, iArgs = 1;
/* get base name and decide what we are doing, detex or delatex */
-@@ -477,7 +490,8 @@
+@@ -477,7 +489,8 @@
** return the termination signal for lex.
******/
@@ -57,7 +54,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
(void)fclose(yyin);
#ifdef FLEX_SCANNER
-@@ -501,8 +515,8 @@
+@@ -501,8 +514,8 @@
** a yyless routine
******/
@@ -68,7 +65,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
int i = strlen(yytext);
-@@ -516,8 +530,8 @@
+@@ -516,8 +529,8 @@
** sbEnvList.
******/
@@ -79,7 +76,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
char *sb;
-@@ -533,8 +547,8 @@
+@@ -533,8 +546,8 @@
** is, sbCurrentEnv is set to sbEnv.
******/
@@ -90,7 +87,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
int i;
-@@ -551,8 +565,8 @@
+@@ -551,8 +564,8 @@
** EndEnv -- checks to see if sbEnv is the current environment being ignored.
******/
@@ -101,7 +98,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
if (!fLatex) return(0);
if (strcmp(sbEnv, sbCurrentEnv) == 0)
-@@ -565,11 +579,9 @@
+@@ -565,11 +578,9 @@
** the sbFile is ignored.
******/
@@ -115,7 +112,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
if (!fFollow)
return;
rgfp[cfp++] = yyin;
-@@ -589,11 +601,9 @@
+@@ -589,11 +600,9 @@
** and open sbFile. If the open fails, the sbFile is ignored.
******/
@@ -129,7 +126,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
if (!fFollow)
return;
if (!InList(sbFile))
-@@ -615,8 +625,8 @@
+@@ -615,8 +624,8 @@
** If the include list is too long, sbFile is ignored.
******/
@@ -140,7 +137,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
if (!fFollow)
return;
-@@ -631,8 +641,8 @@
+@@ -631,8 +640,8 @@
** no list, all files are assumed to be "in the list".
******/
@@ -151,7 +148,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
char *pch, sbBase[MAXPATHLEN];
int i;
-@@ -658,7 +668,8 @@
+@@ -658,9 +667,10 @@
** routine does not honor the '//' construct (expand subdirs).
******/
@@ -159,9 +156,12 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
+void
+SetInputPaths(void)
{
- char *sb, *sbPaths, *getenv();
+- char *sb, *sbPaths, *getenv();
++ char *sb, *sbPaths;
int cchDefaults, cchPaths;
-@@ -698,9 +709,8 @@
+
+ cchDefaults = strlen(DEFAULTINPUTS);
+@@ -698,9 +708,8 @@
** ERROR is returned if there are more than csbMax words.
******/
@@ -173,7 +173,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
int csbList = 0;
-@@ -725,8 +735,7 @@
+@@ -725,8 +734,7 @@
******/
FILE *
@@ -183,7 +183,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
char *pch, *sbNew;
FILE *fp;
-@@ -784,9 +793,7 @@
+@@ -784,9 +792,7 @@
******/
char *
@@ -194,7 +194,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
char *sb;
-@@ -799,8 +806,8 @@
+@@ -799,8 +805,8 @@
** Warning -- print a warning message preceded by the program name.
******/
@@ -205,7 +205,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
(void)fprintf(stderr, "%s: warning: %s %s\n", sbProgName, sb1, sb2);
}
-@@ -810,8 +817,8 @@
+@@ -810,8 +816,8 @@
** Stdout is flushed and detex exits.
******/
@@ -216,7 +216,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
{
(void)fflush(stdout);
(void)fprintf(stderr, "%s: error: %s\n", sbProgName, sb1);
-@@ -823,7 +830,8 @@
+@@ -823,7 +829,8 @@
** OS2UsageExit -- print OS/2 usage message and exit.
******/
diff --git a/Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const b/Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const
deleted file mode 100644
index 8c82386e8d9..00000000000
--- a/Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const
+++ /dev/null
@@ -1,116 +0,0 @@
-diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
---- detex-2.8.orig/detex.l 2010-06-09 13:34:01.000000000 +0200
-+++ detex-2.8/detex.l 2010-06-09 22:11:27.086080276 +0200
-@@ -65,15 +65,15 @@
-
- #undef IGNORE
-
--int BeginEnv(char *sbEnv);
--int EndEnv(char *sbEnv);
-+int BeginEnv(const char *sbEnv);
-+int EndEnv(const char *sbEnv);
- void InputFile(char *sbFile);
- void IncludeFile(char *sbFile);
- void AddInclude(char *sbFile);
- void SetInputPaths(void);
--void SetEnvIgnore(char *sbEnvList);
--void Warning(char *sb1, char *sb2);
--void ErrorExit(char *sb1);
-+void SetEnvIgnore(const char *sbEnvList);
-+void Warning(const char *sb1, const char *sb2);
-+void ErrorExit(const char *sb1);
- int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax);
- int InList(char *sbFile);
- FILE * TexOpen(char *sbFile);
-@@ -87,10 +87,13 @@
- #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2
- #define CITE(x) if (fLatex && !fCite) KILLARGS(x)
-
--char *SafeMalloc(int cch, char *sbMessage);
-+char *SafeMalloc(int cch, const char *sbMessage);
- #ifndef NO_MALLOC_DECL
- char *malloc();
- #endif
-+#ifndef WIN32
-+char *getenv();
-+#endif
- #ifdef OS2
- void yyless(int);
- #endif
-@@ -386,7 +389,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 */
-@@ -531,7 +535,7 @@
- ******/
-
- void
--SetEnvIgnore(char *sbEnvList)
-+SetEnvIgnore(const char *sbEnvList)
- {
- char *sb;
-
-@@ -548,7 +552,7 @@
- ******/
-
- int
--BeginEnv(char *sbEnv)
-+BeginEnv(const char *sbEnv)
- {
- int i;
-
-@@ -566,7 +570,7 @@
- ******/
-
- int
--EndEnv(char *sbEnv)
-+EndEnv(const char *sbEnv)
- {
- if (!fLatex) return(0);
- if (strcmp(sbEnv, sbCurrentEnv) == 0)
-@@ -671,7 +675,11 @@
- void
- SetInputPaths(void)
- {
-- char *sb, *sbPaths, *getenv();
-+ const char *sb;
-+ char *sbPaths;
-+#ifndef WIN32
-+ char *getenv();
-+#endif
- int cchDefaults, cchPaths;
-
- cchDefaults = strlen(DEFAULTINPUTS);
-@@ -793,7 +801,7 @@
- ******/
-
- char *
--SafeMalloc(int cch, char *sbMessage)
-+SafeMalloc(int cch, const char *sbMessage)
- {
- char *sb;
-
-@@ -807,7 +815,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);
- }
-@@ -818,7 +826,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/detex-2.8-PATCHES/patch-03-warnings b/Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings
index 8199c855f6f..d3a9f93eab5 100644
--- a/Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings
+++ b/Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings
@@ -1,8 +1,79 @@
-Only in detex-2.8: detex.c
diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
---- detex-2.8.orig/detex.l 2010-06-09 22:11:27.000000000 +0200
-+++ detex-2.8/detex.l 2010-06-09 23:21:25.969948651 +0200
-@@ -724,7 +724,7 @@
+--- 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;
@@ -11,7 +82,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
*sbList++ = '\0';
}
return(sbList && *sbList ? ERROR : csbList);
-@@ -769,10 +769,12 @@
+@@ -760,10 +762,12 @@
/* If sbFile ends in .tex then it must be there */
if ((pch = rindex(sbFullPath, '.')) != NULL
&& (strcmp(pch, ".tex") == 0))
@@ -24,5 +95,30 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
/* if .<ext> then try to open it. the '.' represents */
/* the beginning of an extension if it is not the first */
-Only in detex-2.8: test.lout
-Only in detex-2.8: test.tout
+@@ -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/detex-2.8-PATCHES/patch-04-kpathsea b/Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea
index 149c479c535..f30d6f81d12 100644
--- a/Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea
+++ b/Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea
@@ -1,16 +1,31 @@
diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
---- detex-2.8.orig/detex.l 2010-06-09 23:21:25.000000000 +0200
-+++ detex-2.8/detex.l 2010-06-10 01:09:20.413856795 +0200
-@@ -49,6 +49,8 @@
+--- 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"
-+#ifndef KPATHSEA
++
++#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,24 +61,52 @@
+@@ -59,10 +76,15 @@
#ifndef MAXPATHLEN
#include <sys/param.h>
#endif
@@ -18,77 +33,37 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
#ifdef OS2
#include <stdlib.h>
#endif
-+#ifndef NO_MALLOC_DECL
-+char *malloc();
-+#endif
-+#ifndef WIN32
-+char *getenv();
-+#endif
-+
-+#else
+
++#endif /* 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"
++#undef IGNORE
+
-+#ifdef HAVE_SYS_PARAM_H
-+#include <sys/param.h>
-+#endif
-+
-+#endif
-
- #undef IGNORE
-
--int BeginEnv(const char *sbEnv);
--int EndEnv(const char *sbEnv);
--void InputFile(char *sbFile);
--void IncludeFile(char *sbFile);
--void AddInclude(char *sbFile);
--void SetInputPaths(void);
--void SetEnvIgnore(const char *sbEnvList);
--void Warning(const char *sb1, const char *sb2);
--void ErrorExit(const char *sb1);
--int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax);
--int InList(char *sbFile);
--FILE * TexOpen(char *sbFile);
-+int BeginEnv(const char *sbEnv);
-+int EndEnv(const char *sbEnv);
-+void InputFile(char *sbFile);
-+void IncludeFile(char *sbFile);
-+void AddInclude(char *sbFile);
-+void SetInputPaths(void);
-+void SetEnvIgnore(const char *sbEnvList);
-+void Warning(const char *sb1, const char *sb2);
-+void ErrorExit(const char *sb1);
-+int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax);
-+int InList(char *sbFile);
-+FILE *TexOpen(char *sbFile);
-+char *SafeMalloc(int cch, const char *sbMessage);
-+#ifdef OS2
-+void yyless(int);
-+void OS2UsageExit(void);
-+#endif
-
#define LaBEGIN if (fLatex) BEGIN
#define IGNORE if (fSpace && !fWord) putchar(' ')
-@@ -87,22 +117,15 @@
- #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2
- #define CITE(x) if (fLatex && !fCite) KILLARGS(x)
-
--char *SafeMalloc(int cch, const char *sbMessage);
--#ifndef NO_MALLOC_DECL
--char *malloc();
--#endif
--#ifndef WIN32
--char *getenv();
--#endif
--#ifdef OS2
--void yyless(int);
--#endif
+ #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 */
@@ -101,7 +76,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
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> */
-@@ -404,6 +427,9 @@
+@@ -400,6 +429,9 @@
_splitpath (rgsbArgs[0], drive, dir, fname, ext);
sbProgName = strlwr(fname);
#else
@@ -111,7 +86,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
if ((sbProgName = rindex(rgsbArgs[0], '/')) != NULL)
sbProgName++;
else
-@@ -411,9 +437,11 @@
+@@ -407,9 +439,11 @@
#endif
if (strcmp("delatex",sbProgName) == 0)
fLatex = 1;
@@ -124,7 +99,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
/* process command line options */
while (iArgs < cArgs && *(pch = rgsbArgs[iArgs]) == CHOPT) {
-@@ -648,7 +676,7 @@
+@@ -644,7 +678,7 @@
int
InList(char *sbFile)
{
@@ -133,7 +108,23 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
int i;
if (csbIncList == 0) /* no list */
-@@ -745,10 +773,12 @@
+@@ -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)
{
@@ -148,7 +139,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
for (iPath = 0; iPath < csbInputPaths; iPath++) {
#ifdef OS2
-@@ -795,7 +825,15 @@
+@@ -788,7 +826,15 @@
if ((fp = fopen(sbFullPath, "r")) != NULL)
return(fp);
}