ruby-changes:16771
From: akr <ko1@a...>
Date: Tue, 27 Jul 2010 23:14:36 +0900 (JST)
Subject: [ruby-changes:16771] Ruby:r28767 (trunk): * ext/pathname/pathname.c (path_taint): use rb_obj_taint.
akr 2010-07-27 23:14:14 +0900 (Tue, 27 Jul 2010) New Revision: 28767 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28767 Log: * ext/pathname/pathname.c (path_taint): use rb_obj_taint. (path_untaint): Pathname#untaint translated from pathname.rb. Modified files: trunk/ChangeLog trunk/ext/pathname/lib/pathname.rb trunk/ext/pathname/pathname.c Index: ChangeLog =================================================================== --- ChangeLog (revision 28766) +++ ChangeLog (revision 28767) @@ -1,3 +1,9 @@ +Tue Jul 27 23:09:09 2010 Tanaka Akira <akr@f...> + + * 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@r...> * lib/mkmf.rb (have_framework): added. Index: ext/pathname/lib/pathname.rb =================================================================== --- ext/pathname/lib/pathname.rb (revision 28766) +++ ext/pathname/lib/pathname.rb (revision 28767) @@ -208,8 +208,6 @@ # :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>) Index: ext/pathname/pathname.c =================================================================== --- ext/pathname/pathname.c (revision 28766) +++ ext/pathname/pathname.c (revision 28767) @@ -57,10 +57,18 @@ 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; +} + void Init_pathname() { @@ -71,4 +79,5 @@ 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); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/