1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

ossl.c: NULL check

* ext/openssl/ossl.c (ossl_make_error): check NULL for unknown
  error reasons with old OpenSSL, and insert a colon iff formatted
  message is not empty.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-03-05 02:58:59 +00:00
parent 5e4ac976b0
commit 89e70fe8e7
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Wed Mar 5 11:58:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/openssl/ossl.c (ossl_make_error): check NULL for unknown
error reasons with old OpenSSL, and insert a colon iff formatted
message is not empty.
Wed Mar 5 00:42:00 2014 Kazuki Tsujimoto <kazuki@callcc.net>
* ext/pathname/lib/pathname.rb (Pathname#find): add "ignore_error"

View file

@ -312,10 +312,11 @@ ossl_make_error(VALUE exc, const char *fmt, va_list args)
else
msg = ERR_reason_error_string(e);
if (NIL_P(str)) {
str = rb_str_new_cstr(msg);
if (msg) str = rb_str_new_cstr(msg);
}
else {
rb_str_cat2(rb_str_cat2(str, ": "), msg);
if (RSTRING_LEN(str)) rb_str_cat2(str, ": ");
rb_str_cat2(str, msg ? msg : "(null)");
}
}
if (dOSSL == Qtrue){ /* show all errors on the stack */