Use strtok() rather than strsep()
authorTatsuo Ishii <ishii at sraoss.co.jp>
Tue, 15 Feb 2005 06:03:38 +0000 (06:03 +0000)
committerTatsuo Ishii <ishii at sraoss.co.jp>
Tue, 15 Feb 2005 06:03:38 +0000 (06:03 +0000)
ChangeLog
NEWS
config.h.in
configure
configure.in
pool_config.c
pool_config.l

index 59f54bb5e63907b7a9eff3981b34de3e39dd2c5f..54c15c10f21db8402c50563d42650160ce03454a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-2005-02-14    <t-ishii@sra.co.jp>
+2005-02-XX    <t-ishii@sra.co.jp>
        * version 2.5.1
        * fix bug in heal checking
          - sometimes health checking period drifts
@@ -8,6 +8,7 @@
        * accept fast/immediate shutdown request while blocking in smart
          shutdown
        * use asprintf to avoid log output confusion (thanks to Jacques Caron)
+       * use sttok rather than strsep
        
 2005-02-02    <t-ishii@sra.co.jp>
        * version 2.5
diff --git a/NEWS b/NEWS
index f84d2f71caf2903072c751cae6df1dde85644eef..1182fabcdf1ef799883fa88d1b75919b7f49f48c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-2.5.1(kaku) 2005/2/14(Mon)
+2.5.1(kaku) 2005/2/XX(XXX)
 
       o 2.5¤ÇÄɲ䵤줿health checkµ¡Ç½¤Î¥Ð¥°½¤Àµ
 
@@ -15,6 +15,8 @@
       o °Û¤Ê¤ë¥×¥í¥»¥¹¤Î¥í¥°½ÐÎϤ¬º®¤¸¤Ã¤Æ¤·¤Þ¤¦¤Î¤òasprintf¤ò»È¤Ã¤Æ²ó
        Èò¤¹¤ë¤è¤¦¤Ë¤·¤¿(Thanks to Jacques Caron)
 
+      o strsep()¤ò¤è¤ê¥Ý¡¼¥¿¥Ö¥ë¤Êstrtok()¤ËÃÖ¤­´¹¤¨¤¿
+
 2.5(kaku) 2005/2/2(Tue)
 
       °Ê²¼¤Îµ¡Ç½¤òÄɲá¥
index 60f604bc480ac3cace710dee0ea66bfba7bae15f..0c0539057c147496bb626696c5c30d206f3a9c33 100644 (file)
@@ -87,6 +87,9 @@
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
+/* Define to 1 if you have the `strtok' function. */
+#undef HAVE_STRTOK
+
 /* Define to 1 if you have the <sys/param.h> header file. */
 #undef HAVE_SYS_PARAM_H
 
index 1f6d7ed83cf9f8474cd7e983db68623c4db2ebd9..b1dd6815ae9ed97946b2243111385dd32b517c29 100755 (executable)
--- a/configure
+++ b/configure
@@ -2603,7 +2603,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=pgpool
- VERSION=2.5.1b1
+ VERSION=2.5.1
 
 
 cat >>confdefs.h <<_ACEOF
@@ -5188,7 +5188,8 @@ fi
 
 
 
-for ac_func in setsid select socket sigprocmask strdup strerror strftime asprintf
+
+for ac_func in setsid select socket sigprocmask strdup strerror strftime strtok asprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
index 670a3d6a6b2b1e4db3c0c00e05ac49eba0d1c6c9..75623d722f972d0e4616fa6f0c24a1af1bc8d329 100644 (file)
@@ -4,7 +4,7 @@ AC_INIT
 dnl Checks for programs.
 AC_PROG_CC
 
-AM_INIT_AUTOMAKE(pgpool, 2.5.1b1)
+AM_INIT_AUTOMAKE(pgpool, 2.5.1)
 
 AM_PROG_LEX
 
@@ -35,7 +35,7 @@ dnl Checks for library functions.
 AC_TYPE_SIGNAL
 AC_FUNC_VPRINTF
 AC_FUNC_WAIT3
-AC_CHECK_FUNCS(setsid select socket sigprocmask strdup strerror strftime asprintf)
+AC_CHECK_FUNCS(setsid select socket sigprocmask strdup strerror strftime strtok asprintf)
 
 PGSQL_INCLUDE_DIR=/usr/local/pgsql/include
 AC_ARG_WITH(pgsql,
index 51ef731c6529fbb716a1165a8e884102ea667de3..4eb40ff2913a8a5433f2762bf2c567a8f8460f92 100644 (file)
@@ -2147,10 +2147,11 @@ static int eval_logical(char *str)
 }
 
 /*
- * extract tokens separated by ',' from str. number of tokens are set
- * to n; note that str will be destroyed. Also return value points to
- * static data, that means subsequent call will change the return
- * value.
+ * extract tokens separated by delimi from str. return value is an
+ * array of pointers to malloced strings. number of tokens is set to
+ * n; note that str will be destroyed by strtok(). Also return value
+ * points to static data, that means subsequent call will change the
+ * return value.
  */
 #define MAXTOKENS 1024
 static char **extract_string_tokens(char *str, char *delimi, int *n)
@@ -2160,7 +2161,7 @@ static char **extract_string_tokens(char *str, char *delimi, int *n)
 
        *n = 0;
 
-       while ((token = strsep(&str, delimi)) && *n < MAXTOKENS)
+       for (token = strtok(str, delimi); token != NULL && *n < MAXTOKENS; token = strtok(NULL, delimi))
        {
                tokens[*n] = strdup(token);
                if (tokens[*n] == NULL)
index 4e4883adaa54494d46f9a7d20d524df639809c66..453079c21f90bff5ac8c6221f7dcd64b77dd01f1 100644 (file)
@@ -610,10 +610,11 @@ static int eval_logical(char *str)
 }
 
 /*
- * extract tokens separated by ',' from str. number of tokens are set
- * to n; note that str will be destroyed. Also return value points to
- * static data, that means subsequent call will change the return
- * value.
+ * extract tokens separated by delimi from str. return value is an
+ * array of pointers to malloced strings. number of tokens is set to
+ * n; note that str will be destroyed by strtok(). Also return value
+ * points to static data, that means subsequent call will change the
+ * return value.
  */
 #define MAXTOKENS 1024
 static char **extract_string_tokens(char *str, char *delimi, int *n)
@@ -623,7 +624,7 @@ static char **extract_string_tokens(char *str, char *delimi, int *n)
 
        *n = 0;
 
-       while ((token = strsep(&str, delimi)) && *n < MAXTOKENS)
+       for (token = strtok(str, delimi); token != NULL && *n < MAXTOKENS; token = strtok(NULL, delimi))
        {
                tokens[*n] = strdup(token);
                if (tokens[*n] == NULL)