summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-26 07:45:49 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-26 07:45:49 +0000
commite8379abcf3aa60db351dfe0745725fcfddb4f324 (patch)
tree7796dcf38ae87288ff590a302c4728b59f5280d7 /file.c
parent355e83f10e4f6fed13cba5785b00aa7585d9c33e (diff)
downloadruby-e8379abcf3aa60db351dfe0745725fcfddb4f324.tar.gz
ruby-e8379abcf3aa60db351dfe0745725fcfddb4f324.tar.xz
ruby-e8379abcf3aa60db351dfe0745725fcfddb4f324.zip
* file.c (ntfs_tail): filename which starts with '.' is valid.
* file.c (file_expand_path): cygwin symlink support. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/file.c b/file.c
index e695582d0..d5f39c797 100644
--- a/file.c
+++ b/file.c
@@ -2555,6 +2555,7 @@ rb_path_end(const char *path)
static char *
ntfs_tail(const char *path)
{
+ while (*path == '.') path++;
while (*path && *path != ':') {
if (istrailinggabage(*path)) {
const char *last = path++;
@@ -2869,7 +2870,7 @@ file_expand_path(VALUE fname, VALUE dname, VALUE result)
#ifdef __CYGWIN__
if (lnk_added && len > 4 &&
STRCASECMP(wfd.cFileName + len - 4, ".lnk") == 0) {
- len -= 4;
+ wfd.cFileName[len -= 4] = '\0';
}
#endif
if (!p) p = buf;