summaryrefslogtreecommitdiff
path: root/Build/source/texk/detex/detex-PATCHES/patch-10-ANSI-strings
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/detex/detex-PATCHES/patch-10-ANSI-strings')
-rw-r--r--Build/source/texk/detex/detex-PATCHES/patch-10-ANSI-strings52
1 files changed, 52 insertions, 0 deletions
diff --git a/Build/source/texk/detex/detex-PATCHES/patch-10-ANSI-strings b/Build/source/texk/detex/detex-PATCHES/patch-10-ANSI-strings
new file mode 100644
index 00000000000..8f03d7b26af
--- /dev/null
+++ b/Build/source/texk/detex/detex-PATCHES/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)