summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-27 14:14:14 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-27 14:14:14 +0000
commit0cb17010c437232e03d8a35cda69dccddba4f4f8 (patch)
tree672afb2da91f742c112e2b4084f82c767c36be61 /ext
parent53b6ab6a047864c32f12a4d4497144c32e25b705 (diff)
* 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')
-rw-r--r--ext/pathname/lib/pathname.rb2
-rw-r--r--ext/pathname/pathname.c11
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);
}