From 84d9c74e5ba4d126227e134af908acd8b821ac20 Mon Sep 17 00:00:00 2001 From: Olaf Weber Date: Sat, 20 Jan 2007 11:02:18 +0000 Subject: Use strchr()/strrchr() instead of index()/rindex(). git-svn-id: svn://tug.org/texlive/trunk@3622 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/detex/detex.l | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Build/source/texk/detex/detex.l b/Build/source/texk/detex/detex.l index d4cb084fc20..16bc1121586 100644 --- a/Build/source/texk/detex/detex.l +++ b/Build/source/texk/detex/detex.l @@ -293,7 +293,7 @@ char *rgsbArgs[]; #ifdef KPATHSEA kpse_set_program_name (rgsbArgs[0], NULL); #endif - if ((sbProgName = rindex(rgsbArgs[0], '/')) != NULL) + if ((sbProgName = strrchr(rgsbArgs[0], '/')) != NULL) sbProgName++; else sbProgName = rgsbArgs[0]; @@ -532,7 +532,7 @@ char *sbFile; 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]) @@ -602,7 +602,7 @@ int csbMax; while (sbList && *sbList && csbList < csbMax) { rgsbList[csbList++] = sbList; - if (sbList = index(sbList, chSep)) + if (sbList = strchr(sbList, chSep)) *sbList++ = '\0'; } return(sbList && *sbList ? ERROR : csbList); @@ -648,7 +648,7 @@ char *sbFile; #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) return(fp); -- cgit v1.2.3