diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-26 06:49:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-26 06:49:46 +0000 |
commit | 522599861208bb705ec6d06b8ab43d4790ffd4f1 (patch) | |
tree | 1dc4582fdd105034f01d720c1900b38aa90160ca /lib | |
parent | 083bddec3e4efbf8e1993424661a33c8bf8995ce (diff) | |
download | ruby-522599861208bb705ec6d06b8ab43d4790ffd4f1.tar.gz |
* lib/pathname.rb (chop_basename, prepend_prefix): use o option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pathname.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pathname.rb b/lib/pathname.rb index 86f0f54800..2b25ca957d 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -274,7 +274,7 @@ class Pathname # chop_basename(path) -> [pre-basename, basename] or nil def chop_basename(path) base = File.basename(path) - if /\A#{SEPARATOR_PAT}?\z/ =~ base + if /\A#{SEPARATOR_PAT}?\z/o =~ base return nil else return path[0, path.rindex(base)], base @@ -296,7 +296,7 @@ class Pathname def prepend_prefix(prefix, relpath) if relpath.empty? File.dirname(prefix) - elsif /#{SEPARATOR_PAT}/ =~ prefix + elsif /#{SEPARATOR_PAT}/o =~ prefix prefix = File.dirname(prefix) prefix = File.join(prefix, "") if File.basename(prefix + 'a') != 'a' prefix + relpath |