1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2013-07-04 17:22:05 +00:00
parent ab7d608632
commit 45116b6a6d
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Fri Jul 5 01:23:33 2013 Akinori MUSHA <knu@iDaemons.org>
* 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@ruby-lang.org>
* lib/mkmf.rb (have_framework): allow header file to check.

View file

@ -910,8 +910,8 @@ module FileUtils
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)