diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-06 19:21:40 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-06 19:21:40 +0000 |
commit | 73fc780998054e9ca4835b784b6fc9051f83332f (patch) | |
tree | d0eb032887b9773dd2c61b0d519d1e037b71fe00 /gc.c | |
parent | 5d0f801aaef21df2d704993d99c623d72a11ae33 (diff) |
merge revision(s) 44861,44862: [Backport #9493]
* gc.c (get_envparam_int): don't accept a value equals to lowerbound
(changed by last commit) because "" or "foo" (not a number) strings
are parsed as 0. They should be rejected.
* gc.c (get_envparam_double): ditto.
* gc.c (get_envparam_int): accept a value equals to lowerbound.
* gc.c (get_envparam_int): correct warning messsages.
* gc.c (get_envparam_double): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -5649,13 +5649,13 @@ get_envparam_int(const char *name, unsigned int *default_value, int lower_bound) if (ptr != NULL) { val = atoi(ptr); - if (val >= lower_bound) { - if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%d (%d)\n", name, val, *default_value); + if (val > lower_bound) { + if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%d (default value: %d)\n", name, val, *default_value); *default_value = val; return 1; } else { - if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%d (%d), but ignored because lower than %d\n", name, val, *default_value, lower_bound); + if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%d (default value: %d) is ignored because it must be greater than %d.\n", name, val, *default_value, lower_bound); } } return 0; @@ -5669,13 +5669,13 @@ get_envparam_double(const char *name, double *default_value, double lower_bound) if (ptr != NULL) { val = strtod(ptr, NULL); - if (val >= lower_bound) { + if (val > lower_bound) { if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%f (%f)\n", name, val, *default_value); *default_value = val; return 1; } else { - if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%f (%f), but ignored because lower than %f\n", name, val, *default_value, lower_bound); + if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%f (default value: %f) is ignored because it must be greater than %f.\n", name, val, *default_value, lower_bound); } } return 0; |