diff options
author | Eric Wong <e@80x24.org> | 2014-02-04 03:01:46 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-02-04 03:01:46 +0000 |
commit | f991debdcc3cbba721029285e4a77f32d8222aa1 (patch) | |
tree | 7661440ab5f149523ce2a78d4ef5ddfc77e66d6c | |
parent | cf4c09c3f280850cd5a018d603e9df08ce54ade2 (diff) | |
download | kgio-f991debdcc3cbba721029285e4a77f32d8222aa1.tar.gz |
In case users run into the same problem in the future. ref: http://mid.gmane.org/20131227074129.GA6381@dcvr.yhbt.net
-rw-r--r-- | ext/kgio/tryopen.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/kgio/tryopen.c b/ext/kgio/tryopen.c index 1d097c7..50bacf4 100644 --- a/ext/kgio/tryopen.c +++ b/ext/kgio/tryopen.c @@ -171,7 +171,13 @@ void init_kgio_tryopen(void) switch (TYPE(err)) { case T_SYMBOL: const_id = SYM2ID(err); break; case T_STRING: const_id = rb_intern(RSTRING_PTR(err)); break; - default: rb_bug("constant not a symbol or string"); + default: { + VALUE i = rb_inspect(err); + const char *s = RSTRING_PTR(i); + + rb_bug("constant not a symbol or string: %s", s); + RB_GC_GUARD(i); + } } error = rb_const_get(rb_mErrno, const_id); |