diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ext/pathname/lib/pathname.rb | 2 | ||||
-rw-r--r-- | ext/pathname/pathname.c | 11 |
3 files changed, 16 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Tue Jul 27 23:09:09 2010 Tanaka Akira <akr@fsij.org> + + * ext/pathname/pathname.c (path_taint): use rb_obj_taint. + (path_untaint): Pathname#untaint translated from + pathname.rb. + Tue Jul 27 18:59:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/mkmf.rb (have_framework): added. diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb index 3fe6c0fc18..139b8e3662 100644 --- a/ext/pathname/lib/pathname.rb +++ b/ext/pathname/lib/pathname.rb @@ -208,8 +208,6 @@ class Pathname # :startdoc: - def untaint() super; @path.untaint; self end - # # Compare this pathname with +other+. The comparison is string-based. # Be aware that two different paths (<tt>foo.txt</tt> and <tt>./foo.txt</tt>) diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index a66fefa53d..2d3a173f5b 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -57,7 +57,15 @@ static VALUE path_taint(VALUE self) { rb_call_super(0, 0); - OBJ_TAINT(get_strpath(self)); + rb_obj_taint(get_strpath(self)); + return self; +} + +static VALUE +path_untaint(VALUE self) +{ + rb_call_super(0, 0); + rb_obj_untaint(get_strpath(self)); return self; } @@ -71,4 +79,5 @@ Init_pathname() rb_define_method(rb_cPathname, "initialize", path_initialize, 1); rb_define_method(rb_cPathname, "freeze", path_freeze, 0); rb_define_method(rb_cPathname, "taint", path_taint, 0); + rb_define_method(rb_cPathname, "untaint", path_untaint, 0); } |