properly export tsrm_strtok_r()

for this particular case fixing phar shared build, but for the
general usage anyway
This commit is contained in:
Anatol Belski 2014-10-05 13:20:27 +02:00
parent 7c7b9184b1
commit d58b70622a
3 changed files with 4 additions and 50 deletions

View file

@ -14,7 +14,7 @@ static inline int in_character_class(char ch, const char *delim)
return 0;
}
char *tsrm_strtok_r(char *s, const char *delim, char **last)
TSRM_API char *tsrm_strtok_r(char *s, const char *delim, char **last)
{
char *token;

View file

@ -1,6 +1,8 @@
#ifndef TSRM_STRTOK_R
#define TSRM_STRTOK_R
char *tsrm_strtok_r(char *s, const char *delim, char **last);
#include "TSRM.h"
TSRM_API char *tsrm_strtok_r(char *s, const char *delim, char **last);
#endif

View file

@ -2072,54 +2072,6 @@ static int php_check_dots(const char *element, int n) /* {{{ */
#define IS_BACKSLASH(c) ((c) == '/')
#ifdef COMPILE_DL_PHAR
/* stupid-ass non-extern declaration in tsrm_strtok.h breaks dumbass MS compiler */
static inline int in_character_class(char ch, const char *delim) /* {{{ */
{
while (*delim) {
if (*delim == ch) {
return 1;
}
++delim;
}
return 0;
}
/* }}} */
char *tsrm_strtok_r(char *s, const char *delim, char **last) /* {{{ */
{
char *token;
if (s == NULL) {
s = *last;
}
while (*s && in_character_class(*s, delim)) {
++s;
}
if (!*s) {
return NULL;
}
token = s;
while (*s && !in_character_class(*s, delim)) {
++s;
}
if (!*s) {
*last = s;
} else {
*s = '\0';
*last = s + 1;
}
return token;
}
/* }}} */
#endif
/**
* Remove .. and . references within a phar filename
*/