summaryrefslogtreecommitdiff
path: root/Build/source/texk/detex/detex-PATCHES/patch-10-ANSI-strings
blob: 8f03d7b26af2824c70ca2fb26cb2a2189bab3f1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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)