]> granicus.if.org Git - php/commitdiff
Remove unused tsrm_strtok_r() function
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 12 Jul 2019 11:12:56 +0000 (13:12 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 12 Jul 2019 11:14:24 +0000 (13:14 +0200)
There is also a php_strtok_r() function, which is actually used,
but nothing uses the tsrm_strtok_r() variant...

TSRM/config.w32
TSRM/tsrm_strtok_r.c [deleted file]
TSRM/tsrm_strtok_r.h [deleted file]
configure.ac
ext/phar/phar_internal.h

index c65a91cc975c0ebd8ec4f47c172ec7f1dcdcc4b5..fa7145ae4dc846a76e3a94e739822b7fc174b2cb 100644 (file)
@@ -1,4 +1,4 @@
 // vim:ft=javascript
 
-ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_win32.c");
+ADD_SOURCES("TSRM", "TSRM.c tsrm_win32.c");
 ADD_FLAG("CFLAGS_BD_TSRM", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
diff --git a/TSRM/tsrm_strtok_r.c b/TSRM/tsrm_strtok_r.c
deleted file mode 100644 (file)
index 472105b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <stdio.h>
-
-#include "tsrm_config_common.h"
-#include "tsrm_strtok_r.h"
-
-static inline int in_character_class(char ch, const char *delim)
-{/*{{{*/
-       while (*delim) {
-               if (*delim == ch) {
-                       return 1;
-               }
-               delim++;
-       }
-       return 0;
-}/*}}}*/
-
-TSRM_API 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;
-}/*}}}*/
-
-#if 0
-
-main()
-{
-       char foo[] = "/foo/bar//\\barbara";
-       char *last;
-       char *token;
-
-       token = tsrm_strtok_r(foo, "/\\", &last);
-       while (token) {
-               printf ("Token = '%s'\n", token);
-               token = tsrm_strtok_r(NULL, "/\\", &last);
-       }
-
-       return 0;
-}
-
-#endif
diff --git a/TSRM/tsrm_strtok_r.h b/TSRM/tsrm_strtok_r.h
deleted file mode 100644 (file)
index 323b401..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef TSRM_STRTOK_R
-#define TSRM_STRTOK_R
-
-#include "TSRM.h"
-
-TSRM_API char *tsrm_strtok_r(char *s, const char *delim, char **last);
-
-#endif
index e4ff616306df1319c3ad5e305e2553047c42aba3..eb2971bfa2ba4c9f8c4a0685c30d516ceb47691d 100644 (file)
@@ -1521,7 +1521,7 @@ PHP_SUBST(install_binary_targets)
 
 PHP_INSTALL_HEADERS([Zend/ TSRM/ include/ main/ main/streams/])
 
-PHP_ADD_SOURCES(TSRM, TSRM.c tsrm_strtok_r.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
+PHP_ADD_SOURCES(TSRM, TSRM.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
 
 PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c \
        fopen_wrappers.c alloca.c  php_scandir.c \
index 8b2f585161e29f612068bb024e8819c88f6bf1d2..e999d9d75746614255a92b6293f75d787d808fb4 100644 (file)
@@ -49,9 +49,6 @@
 #include "ext/standard/sha1.h"
 #include "ext/standard/php_var.h"
 #include "ext/standard/php_versioning.h"
-#ifndef PHP_WIN32
-#include "TSRM/tsrm_strtok_r.h"
-#endif
 #include "Zend/zend_virtual_cwd.h"
 #include "ext/spl/spl_array.h"
 #include "ext/spl/spl_directory.h"
@@ -477,8 +474,6 @@ extern zend_string *(*phar_save_resolve_path)(const char *filename, size_t filen
 BEGIN_EXTERN_C()
 
 #ifdef PHP_WIN32
-char *tsrm_strtok_r(char *s, const char *delim, char **last);
-
 static inline void phar_unixify_path_separators(char *path, size_t path_len)
 {
        char *s;