diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/pathname.rb | 4 |
2 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Mon Jan 26 15:49:42 2009 Nobuyoshi Nakada <[email protected]> + + * lib/pathname.rb (chop_basename, prepend_prefix): use o option. + Mon Jan 26 14:15:00 2009 Nobuyoshi Nakada <[email protected]> * eval.c (Init_Thread): provides "continuation.so" for forward 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 |