summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-10 18:31:36 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-10 18:31:36 +0000
commit09306bcead5dee0fb3ce56d8bd0ff91b2cdca4fa (patch)
tree150e2eefc4a2351ea65cb62604e85e2eaa403b3e
parentea00e4e454d56169412ac42a217aa02208249930 (diff)
* lib/ext/openssl/ossl_conf.c (ossl_config_get_value): return nil
if the specified value doesn't exist. * lib/ext/openssl/ossl_conf.c (ossl_config_get_section): return a empty hash if the specified section doesn't exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--ext/openssl/ossl_config.c10
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 9d5cfb83ff..8ee4dc4a33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue Nov 11 03:30:43 JST 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * lib/ext/openssl/ossl_conf.c (ossl_config_get_value): return nil
+ if the specified value doesn't exist.
+
+ * lib/ext/openssl/ossl_conf.c (ossl_config_get_section): return
+ a empty hash if the specified section doesn't exist.
+
Mon Nov 10 11:40:29 2003 Shugo Maeda <shugo@ruby-lang.org>
* lib/monitor.rb (wait): return true on signal/broadcastfalse and
diff --git a/ext/openssl/ossl_config.c b/ext/openssl/ossl_config.c
index 78fae970de..7e6f696d33 100644
--- a/ext/openssl/ossl_config.c
+++ b/ext/openssl/ossl_config.c
@@ -199,7 +199,10 @@ ossl_config_get_value(VALUE self, VALUE section, VALUE name)
StringValue(section);
StringValue(name);
str = NCONF_get_string(conf, RSTRING(section)->ptr, RSTRING(name)->ptr);
- if(!str) ossl_raise(eConfigError, NULL);
+ if(!str){
+ ERR_clear_error();
+ return Qnil;
+ }
return rb_str_new2(str);
}
@@ -257,11 +260,12 @@ ossl_config_get_section(VALUE self, VALUE section)
int i, entries;
VALUE hash;
+ hash = rb_hash_new();
GetConfig(self, conf);
if (!(sk = NCONF_get_section(conf, StringValuePtr(section)))) {
- ossl_raise(eConfigError, NULL);
+ ERR_clear_error();
+ return hash;
}
- hash = rb_hash_new();
if ((entries = sk_CONF_VALUE_num(sk)) < 0) {
OSSL_Debug("# of items in section is < 0?!?");
return hash;