summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-25 05:11:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-25 05:11:35 +0000
commit14aed229eaa44f5cef6d692d9dfdf34b2d6511e5 (patch)
tree7d750df4f964908da9f554310f0e2d412582355f /win32/win32.c
parent2f6fdd3aebdee2ce04d003b206f6da78120e8235 (diff)
win32.c: fix offset
* win32/win32.c (opendir_internal): fix offset not to overwrite a backslash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 9b838b5..b648fcc 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1951,7 +1951,7 @@ opendir_internal(WCHAR *wpath, const char *filename)
WCHAR *tmppath = malloc((pathlen + len + 1) * sizeof(WCHAR));
memcpy(tmppath, wpath, pathlen * sizeof(WCHAR));
tmppath[pathlen] = L'\\';
- memcpy(tmppath + pathlen, fd.cFileName, len * sizeof(WCHAR));
+ memcpy(tmppath + pathlen + 1, fd.cFileName, len * sizeof(WCHAR));
if (rb_w32_reparse_symlink_p(tmppath))
SetBit(p->bits, BitOfIsRep(p->nfiles));
free(tmppath);