summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ext/pathname/lib/pathname.rb2
-rw-r--r--ext/pathname/pathname.c11
3 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 48d17f07c2..d9c567d58f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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);
}