ruby-changes:29729
From: knu <ko1@a...>
Date: Fri, 5 Jul 2013 02:22:16 +0900 (JST)
Subject: [ruby-changes:29729] knu:r41781 (trunk): * lib/fileutils.rb (FileUtils#symbolic_modes_to_i): Fix the wrong
knu 2013-07-05 02:22:05 +0900 (Fri, 05 Jul 2013) New Revision: 41781 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41781 Log: * lib/fileutils.rb (FileUtils#symbolic_modes_to_i): Fix the wrong character class [+-=], which happened to match all desired characters but also match undesired characters. Modified files: trunk/ChangeLog trunk/lib/fileutils.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 41780) +++ ChangeLog (revision 41781) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Jul 5 01:23:33 2013 Akinori MUSHA <knu@i...> + + * lib/fileutils.rb (FileUtils#symbolic_modes_to_i): Fix the wrong + character class [+-=], which happened to match all desired + characters but also match undesired characters. + Fri Jul 5 00:25:39 2013 Nobuyoshi Nakada <nobu@r...> * lib/mkmf.rb (have_framework): allow header file to check. Index: lib/fileutils.rb =================================================================== --- lib/fileutils.rb (revision 41780) +++ lib/fileutils.rb (revision 41781) @@ -910,8 +910,8 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L910 def symbolic_modes_to_i(modes, path) #:nodoc: current_mode = (File.stat(path).mode & 07777) modes.split(/,/).inject(0) do |mode, mode_sym| - mode_sym = "a#{mode_sym}" if mode_sym =~ %r!^[+-=]! - target, mode = mode_sym.split %r![+-=]! + mode_sym = "a#{mode_sym}" if mode_sym =~ %r!^[=+-]! + target, mode = mode_sym.split %r![=+-]! user_mask = user_mask(target) mode_mask = mode_mask(mode ? mode : "", path) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/