summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-26 06:49:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-26 06:49:46 +0000
commitc93f31d41600736ec1f58cc20b0d202a429d4fe6 (patch)
treebdb9f99bd1ea73abd7ad8f0b28a762ca5a6eb701 /lib
parent2af5d793a871c59f2804c6139da471e07a142cd9 (diff)
* lib/pathname.rb (chop_basename, prepend_prefix): use o option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@21779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/pathname.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pathname.rb b/lib/pathname.rb
index e4ca5489ce..d1e41e2f6a 100644
--- a/lib/pathname.rb
+++ b/lib/pathname.rb
@@ -263,7 +263,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
@@ -285,7 +285,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