From 84ae1c61b40667e4cc5197a14c5f57a43ffc2820 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 4 Jan 2002 14:15:33 +0000 Subject: * process.c (rb_f_system): abandon vfork. * io.c (pipe_open): ditto. * defines.h: sparc linux needs different FLUSH_REGISTER_WINDOWS * regex.c (re_search): abandon stclass optimization. * bignum.c (rb_cstr2inum): deny "0_". * bignum.c (rb_cstr2inum): allow "0\n" and so on. * error.c (rb_invalid_str): utility function to show inspect()'ed string. * bignum.c (rb_cstr2inum): prints invalid strings in inspect()'ed format. * object.c (rb_Float): ditto. * object.c (rb_convert_type): no longer use rb_rescue(). * re.c (rb_reg_search): initialize taint status of match object. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- error.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'error.c') diff --git a/error.c b/error.c index 010a27243..d8dab15df 100644 --- a/error.c +++ b/error.c @@ -447,6 +447,15 @@ nometh_args(self) return rb_iv_get(self, "args"); } +void +rb_invalid_str(str, type) + const char *str, *type; +{ + VALUE s = rb_str_inspect(rb_str_new2(str)); + + rb_raise(rb_eArgError, "invalid value for %s: %s", type, RSTRING(s)->ptr); +} + #ifdef __BEOS__ typedef struct { VALUE *list; -- cgit