summaryrefslogtreecommitdiff
path: root/Build/source/texk/detex/TLpatches/patch-01-ANSI-C
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/detex/TLpatches/patch-01-ANSI-C')
-rw-r--r--Build/source/texk/detex/TLpatches/patch-01-ANSI-C228
1 files changed, 228 insertions, 0 deletions
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);