[前][次][番号順一覧][スレッド一覧]

ruby-changes:32795

From: nobu <ko1@a...>
Date: Fri, 7 Feb 2014 11:03:04 +0900 (JST)
Subject: [ruby-changes:32795] nobu:r44874 (trunk): gc.c: ignore empty strings

nobu	2014-02-07 11:02:58 +0900 (Fri, 07 Feb 2014)

  New Revision: 44874

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44874

  Log:
    gc.c: ignore empty strings
    
    * gc.c (get_envparam_size, get_envparam_double): silently ignore empty
      strings, without any warnings regardless $VERBOSE.

  Modified files:
    trunk/gc.c
Index: gc.c
===================================================================
--- gc.c	(revision 44873)
+++ gc.c	(revision 44874)
@@ -5651,7 +5651,7 @@ get_envparam_size(const char *name, size https://github.com/ruby/ruby/blob/trunk/gc.c#L5651
     char *ptr = getenv(name);
     ssize_t val;
 
-    if (ptr != NULL) {
+    if (ptr != NULL && *ptr) {
 	char *end;
 #if SIZEOF_SIZE_T == SIZEOF_LONG_LONG
 	val = strtoll(ptr, &end, 0);
@@ -5686,7 +5686,7 @@ get_envparam_double(const char *name, do https://github.com/ruby/ruby/blob/trunk/gc.c#L5686
     char *ptr = getenv(name);
     double val;
 
-    if (ptr != NULL) {
+    if (ptr != NULL && *ptr) {
 	char *end;
 	val = strtod(ptr, &end);
 	if (!*ptr || *end) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]