diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-07 02:02:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-07 02:02:58 +0000 |
commit | 5fe0030d023c6c53d14464f8fba903b2b041b3d9 (patch) | |
tree | 519e7f192e81bf3755e3be582922b6ccd7074bcf /gc.c | |
parent | 9ba0b76fb37764e9d63314292d11158784ab4cbc (diff) | |
download | ruby-5fe0030d023c6c53d14464f8fba903b2b041b3d9.tar.gz |
gc.c: ignore empty strings
* gc.c (get_envparam_size, get_envparam_double): silently ignore empty
strings, without any warnings regardless $VERBOSE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -5651,7 +5651,7 @@ get_envparam_size(const char *name, size_t *default_value, size_t lower_bound) 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, double *default_value, double lower_bound) char *ptr = getenv(name); double val; - if (ptr != NULL) { + if (ptr != NULL && *ptr) { char *end; val = strtod(ptr, &end); if (!*ptr || *end) { |