From 14aed229eaa44f5cef6d692d9dfdf34b2d6511e5 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 25 Aug 2015 05:11:35 +0000 Subject: 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 --- win32/win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'win32/win32.c') diff --git a/win32/win32.c b/win32/win32.c index 9b838b516e..b648fcc0af 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); -- cgit v1.2.3