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 -#define index strchr -#define rindex strrchr #else #include +#define strchr index +#define strrchr rindex #endif #ifndef MAXPATHLEN #include @@ -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)