diff options
Diffstat (limited to 'string/string-inlines.c')
-rw-r--r-- | string/string-inlines.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/string/string-inlines.c b/string/string-inlines.c index d43e5897c3..7b1de7180f 100644 --- a/string/string-inlines.c +++ b/string/string-inlines.c @@ -63,6 +63,70 @@ __old_strtok_r_1c (char *__s, char __sep, char **__nextp) return __result; } compat_symbol (libc, __old_strtok_r_1c, __strtok_r_1c, GLIBC_2_1_1); + +char * +__old_strsep_1c (char **__s, char __reject) +{ + char *__retval = *__s; + if (__retval != NULL && (*__s = strchr (__retval, __reject)) != NULL) + *(*__s)++ = '\0'; + return __retval; +} +compat_symbol (libc, __old_strsep_1c, __strsep_1c, GLIBC_2_1_1); + +char * +__old_strsep_2c (char **__s, char __reject1, char __reject2) +{ + char *__retval = *__s; + if (__retval != NULL) + { + char *__cp = __retval; + while (1) + { + if (*__cp == '\0') + { + __cp = NULL; + break; + } + if (*__cp == __reject1 || *__cp == __reject2) + { + *__cp++ = '\0'; + break; + } + ++__cp; + } + *__s = __cp; + } + return __retval; +} +compat_symbol (libc, __old_strsep_2c, __strsep_2c, GLIBC_2_1_1); + +char * +__old_strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) +{ + char *__retval = *__s; + if (__retval != NULL) + { + char *__cp = __retval; + while (1) + { + if (*__cp == '\0') + { + __cp = NULL; + break; + } + if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) + { + *__cp++ = '\0'; + break; + } + ++__cp; + } + *__s = __cp; + } + return __retval; +} +compat_symbol (libc, __old_strsep_3c, __strsep_3c, GLIBC_2_1_1); #endif #if SHLIB_COMPAT (libc, GLIBC_2_1_1, GLIBC_2_24) |