summaryrefslogtreecommitdiff
path: root/ext/pathname
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pathname')
-rw-r--r--ext/pathname/lib/pathname.rb1
-rw-r--r--ext/pathname/pathname.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index 56e3a4525f..3fe6c0fc18 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -208,7 +208,6 @@ class Pathname
# :startdoc:
- def taint() super; @path.taint; self end
def untaint() super; @path.untaint; self end
#
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index cba325b0dc..a66fefa53d 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -53,6 +53,14 @@ path_freeze(VALUE self)
return self;
}
+static VALUE
+path_taint(VALUE self)
+{
+ rb_call_super(0, 0);
+ OBJ_TAINT(get_strpath(self));
+ return self;
+}
+
void
Init_pathname()
{
@@ -62,4 +70,5 @@ Init_pathname()
rb_cPathname = rb_define_class("Pathname", rb_cObject);
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);
}