diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-27 14:14:14 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-27 14:14:14 +0000 |
commit | 0cb17010c437232e03d8a35cda69dccddba4f4f8 (patch) | |
tree | 672afb2da91f742c112e2b4084f82c767c36be61 /ext/pathname | |
parent | 53b6ab6a047864c32f12a4d4497144c32e25b705 (diff) | |
download | ruby-0cb17010c437232e03d8a35cda69dccddba4f4f8.tar.gz |
* ext/pathname/pathname.c (path_taint): use rb_obj_taint.
(path_untaint): Pathname#untaint translated from
pathname.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pathname')
-rw-r--r-- | ext/pathname/lib/pathname.rb | 2 | ||||
-rw-r--r-- | ext/pathname/pathname.c | 11 |
2 files changed, 10 insertions, 3 deletions
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); } |