diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-06-28 06:17:11 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-06-28 06:17:11 +0000 |
commit | d255e898b99b63f264f3a3848a0cfe80473b4c84 (patch) | |
tree | 3566826ff4a05d51e97c8fe9378d72b74062c909 /Build/source/texk/detex/detex-2.8 | |
parent | 0277c6bc6f2dd4647bc8a7e14640bdf262a45a34 (diff) |
Replace BSD string functions (removed in POSIX.1-2008) by SYSV/ANSI equivalents
git-svn-id: svn://tug.org/texlive/trunk@30997 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/detex/detex-2.8')
-rw-r--r-- | Build/source/texk/detex/detex-2.8/detex.c | 12 | ||||
-rw-r--r-- | Build/source/texk/detex/detex-2.8/detex.l | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/Build/source/texk/detex/detex-2.8/detex.c b/Build/source/texk/detex/detex-2.8/detex.c index c6114c5b71d..58188654f02 100644 --- a/Build/source/texk/detex/detex-2.8/detex.c +++ b/Build/source/texk/detex/detex-2.8/detex.c @@ -1531,10 +1531,10 @@ static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/0 #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> @@ -3759,7 +3759,7 @@ main(int cArgs, char *rgsbArgs[]) 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]; @@ -4015,7 +4015,7 @@ InList(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]) @@ -4084,7 +4084,7 @@ SeparateList(char *sbList, char *rgsbList[], char chSep, 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 ? my_ERROR : csbList); @@ -4129,7 +4129,7 @@ TexOpen(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) diff --git a/Build/source/texk/detex/detex-2.8/detex.l b/Build/source/texk/detex/detex-2.8/detex.l index aab1d7096ef..23c22e35f69 100644 --- a/Build/source/texk/detex/detex-2.8/detex.l +++ b/Build/source/texk/detex/detex-2.8/detex.l @@ -70,10 +70,10 @@ static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/0 #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 @@ main(int cArgs, char *rgsbArgs[]) 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 @@ InList(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]) @@ -770,7 +770,7 @@ SeparateList(char *sbList, char *rgsbList[], char chSep, 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 ? my_ERROR : csbList); @@ -815,7 +815,7 @@ TexOpen(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) |