summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_config.c
diff options
context:
space:
mode:
authormichal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-12 13:46:48 +0000
committermichal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-12 13:46:48 +0000
commitbd96b4c8ccbfbaf68c6996d74515fd603b2aea63 (patch)
tree7585c4dabc044459b4cfb92230bdff20fb882087 /ext/openssl/ossl_config.c
parentecf0c48d5a8308500f2331287fe88c88d6c43b70 (diff)
OpenSSL update
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_config.c')
-rw-r--r--ext/openssl/ossl_config.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/openssl/ossl_config.c b/ext/openssl/ossl_config.c
index baed834..78fae97 100644
--- a/ext/openssl/ossl_config.c
+++ b/ext/openssl/ossl_config.c
@@ -52,7 +52,6 @@ GetConfigPtr(VALUE obj)
CONF *
DupConfigPtr(VALUE obj)
{
- CONF *conf;
VALUE str;
OSSL_Check_Kind(obj, cConfig);
@@ -70,7 +69,6 @@ parse_config(VALUE str, CONF *dst)
CONF *conf;
BIO *bio;
long eline = -1;
- VALUE obj;
bio = ossl_obj2bio(str);
conf = dst ? dst : NCONF_new(NULL);
@@ -210,7 +208,17 @@ static VALUE
ossl_config_get_value_old(int argc, VALUE *argv, VALUE self)
{
VALUE section, name;
+
rb_scan_args(argc, argv, "11", &section, &name);
+
+ /* support conf.value(nil, "HOME") -> conf.get_value("", "HOME") */
+ if (NIL_P(section)) section = rb_str_new2("");
+ /* support conf.value("HOME") -> conf.get_value("", "HOME") */
+ if (NIL_P(name)) {
+ name = section;
+ section = rb_str_new2("");
+ }
+ /* NOTE: Don't care about conf.get_value(nil, nil) */
rb_warn("Config#value is deprecated; use Config#get_value");
return ossl_config_get_value(self, section, name);
}