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 | 50d2329f328a5cdba5db6bbdbc1fa9d369a5a3da (patch) | |
| tree | af8a6723a18286d1f50034f31fbd60b783f9b5b6 /sample | |
| parent | ce49de8b83cf2d5cc936691843dfaecf5a8db127 (diff) | |
| download | ruby-50d2329f328a5cdba5db6bbdbc1fa9d369a5a3da.tar.gz ruby-50d2329f328a5cdba5db6bbdbc1fa9d369a5a3da.tar.xz ruby-50d2329f328a5cdba5db6bbdbc1fa9d369a5a3da.zip | |
* 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: http://svn.ruby-lang.org/repos/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 7194e072b..d0a364f17 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") |
