{"thread":{"id":"33020","subject":"[PATCH v2] Revert \"compat: add strtok_r()\"","startedAt":"2013-02-26T16:58:38Z","lastAt":"2013-02-26T17:18:47Z","messageCount":2,"participants":["Erik Faye-Lund","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"210336","messageId":"1361897918-8824-1-git-send-email-kusmabite@gmail.com","threadId":"33020","inReplyTo":null,"subject":"[PATCH v2] Revert \"compat: add strtok_r()\"","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2013-02-26T16:58:38Z","receivedAt":"2013-02-26T16:58:38Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"This reverts commit 78457bc0ccc1af8b9eb776a0b17986ebd50442bc.\n\ncommit 28c5d9e (\"vcs-svn: drop string_pool\") previously removed\nthe only call-site for strtok_r. So let's get rid of the compat\nimplementation as well.\n\nSigned-off-by: Erik Faye-Lund <kusmabite@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile          |  6 ------\n compat/strtok_r.c | 61 -------------------------------------------------------\n config.mak.uname  |  2 --\n configure.ac      |  6 ------\n git-compat-util.h |  5 -----\n 5 files changed, 80 deletions(-)\n delete mode 100644 compat/strtok_r.c\n\ndiff --git a/Makefile b/Makefile\nindex 1b30d7b..6d16a52 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -98,8 +98,6 @@ all::\n #\n # Define NO_MKSTEMPS if you don't have mkstemps in the C library.\n #\n-# Define NO_STRTOK_R if you don't have strtok_r in the C library.\n-#\n # Define NO_FNMATCH if you don't have fnmatch in the C library.\n #\n # Define NO_FNMATCH_CASEFOLD if your fnmatch function doesn't have the\n@@ -1202,10 +1200,6 @@ endif\n ifdef NO_STRTOULL\n \tCOMPAT_CFLAGS += -DNO_STRTOULL\n endif\n-ifdef NO_STRTOK_R\n-\tCOMPAT_CFLAGS += -DNO_STRTOK_R\n-\tCOMPAT_OBJS += compat/strtok_r.o\n-endif\n ifdef NO_FNMATCH\n \tCOMPAT_CFLAGS += -Icompat/fnmatch\n \tCOMPAT_CFLAGS += -DNO_FNMATCH\ndiff --git a/compat/strtok_r.c b/compat/strtok_r.c\ndeleted file mode 100644\nindex 7b5d568..0000000\n--- a/compat/strtok_r.c\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-/* Reentrant string tokenizer.  Generic version.\n-   Copyright (C) 1991,1996-1999,2001,2004 Free Software Foundation, Inc.\n-   This file is part of the GNU C Library.\n-\n-   The GNU C Library is free software; you can redistribute it and/or\n-   modify it under the terms of the GNU Lesser General Public\n-   License as published by the Free Software Foundation; either\n-   version 2.1 of the License, or (at your option) any later version.\n-\n-   The GNU C Library is distributed in the hope that it will be useful,\n-   but WITHOUT ANY WARRANTY; without even the implied warranty of\n-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n-   Lesser General Public License for more details.\n-\n-   You should have received a copy of the GNU Lesser General Public\n-   License along with the GNU C Library; if not, write to the Free\n-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n-   02111-1307 USA.  */\n-\n-#include \"../git-compat-util.h\"\n-\n-/* Parse S into tokens separated by characters in DELIM.\n-   If S is NULL, the saved pointer in SAVE_PTR is used as\n-   the next starting point.  For example:\n-\tchar s[] = \"-abc-=-def\";\n-\tchar *sp;\n-\tx = strtok_r(s, \"-\", &sp);\t// x = \"abc\", sp = \"=-def\"\n-\tx = strtok_r(NULL, \"-=\", &sp);\t// x = \"def\", sp = NULL\n-\tx = strtok_r(NULL, \"=\", &sp);\t// x = NULL\n-\t\t// s = \"abc\\0-def\\0\"\n-*/\n-char *\n-gitstrtok_r (char *s, const char *delim, char **save_ptr)\n-{\n-  char *token;\n-\n-  if (s == NULL)\n-    s = *save_ptr;\n-\n-  /* Scan leading delimiters.  */\n-  s += strspn (s, delim);\n-  if (*s == '\\0')\n-    {\n-      *save_ptr = s;\n-      return NULL;\n-    }\n-\n-  /* Find the end of the token.  */\n-  token = s;\n-  s = strpbrk (token, delim);\n-  if (s == NULL)\n-    /* This token finishes the string.  */\n-    *save_ptr = token + strlen (token);\n-  else\n-    {\n-      /* Terminate the token and make *SAVE_PTR point past it.  */\n-      *s = '\\0';\n-      *save_ptr = s + 1;\n-    }\n-  return token;\n-}\ndiff --git a/config.mak.uname b/config.mak.uname\nindex bea34f0..7f3018f 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -321,7 +321,6 @@ ifeq ($(uname_S),Windows)\n \tNO_UNSETENV = YesPlease\n \tNO_STRCASESTR = YesPlease\n \tNO_STRLCPY = YesPlease\n-\tNO_STRTOK_R = YesPlease\n \tNO_FNMATCH = YesPlease\n \tNO_MEMMEM = YesPlease\n \t# NEEDS_LIBICONV = YesPlease\n@@ -476,7 +475,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))\n \tNO_UNSETENV = YesPlease\n \tNO_STRCASESTR = YesPlease\n \tNO_STRLCPY = YesPlease\n-\tNO_STRTOK_R = YesPlease\n \tNO_FNMATCH = YesPlease\n \tNO_MEMMEM = YesPlease\n \tNEEDS_LIBICONV = YesPlease\ndiff --git a/configure.ac b/configure.ac\nindex 1991258..f3462d9 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -901,12 +901,6 @@ GIT_CHECK_FUNC(strcasestr,\n [NO_STRCASESTR=YesPlease])\n GIT_CONF_SUBST([NO_STRCASESTR])\n #\n-# Define NO_STRTOK_R if you don't have strtok_r\n-GIT_CHECK_FUNC(strtok_r,\n-[NO_STRTOK_R=],\n-[NO_STRTOK_R=YesPlease])\n-GIT_CONF_SUBST([NO_STRTOK_R])\n-#\n # Define NO_FNMATCH if you don't have fnmatch\n GIT_CHECK_FUNC(fnmatch,\n [NO_FNMATCH=],\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex e5a4b74..89a44ab 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -408,11 +408,6 @@ extern uintmax_t gitstrtoumax(const char *, char **, int);\n extern intmax_t gitstrtoimax(const char *, char **, int);\n #endif\n \n-#ifdef NO_STRTOK_R\n-#define strtok_r gitstrtok_r\n-extern char *gitstrtok_r(char *s, const char *delim, char **save_ptr);\n-#endif\n-\n #ifdef NO_HSTRERROR\n #define hstrerror githstrerror\n extern const char *githstrerror(int herror);\n-- \n1.8.0.msysgit.0.3.gd0186ec\n"},{"id":"210338","messageId":"7vobf7m1s8.fsf@alter.siamese.dyndns.org","threadId":"33020","inReplyTo":"1361897918-8824-1-git-send-email-kusmabite@gmail.com","subject":"Re: [PATCH v2] Revert \"compat: add strtok_r()\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-26T17:18:47Z","receivedAt":"2013-02-26T17:18:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}