diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-02-16 10:22:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-02-16 10:22:36 +0000 |
commit | d0d70d648d7ef2a8c1de2f141b1ab5cda109d561 (patch) | |
tree | af8a6723a18286d1f50034f31fbd60b783f9b5b6 /sample | |
parent | 2f7275db779be068e3401376224601251f01046b (diff) |
* file.c (file_expand_path): buffer might be reallocated while
expanding default directory.
* file.c (file_expand_path): default directory was being
ignored if path was full path with no drive letter, under
DOSISH.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r-- | sample/test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sample/test.rb b/sample/test.rb index 7194e072b1..d0a364f17c 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -1675,13 +1675,21 @@ case Dir.pwd when %r'\A\w:' test_ok(/\A\w:\/\z/ =~ File.expand_path(".", "/")) test_ok(/\A\w:\/a\z/ =~ File.expand_path("a", "/")) + dosish = true when %r'\A//' test_ok(%r'\A//[^/]+/[^/]+\z' =~ File.expand_path(".", "/")) test_ok(%r'\A//[^/]+/[^/]+/a\z' =~ File.expand_path(".", "/")) + dosish = true else test_ok(File.expand_path(".", "/") == "/") test_ok(File.expand_path("sub", "/") == "/sub") end +if dosish + test_ok(File.expand_path("/", "//machine/share/sub") == "//machine/share") + test_ok(File.expand_path("/dir", "//machine/share/sub") == "//machine/share/dir") + test_ok(File.expand_path("/", "z:/sub") == "z:/") + test_ok(File.expand_path("/dir", "z:/sub") == "z:/dir") +end test_ok(File.expand_path(".", "//") == "//") test_ok(File.expand_path("sub", "//") == "//sub") |