[前][次][番号順一覧][スレッド一覧]

ruby-changes:39596

From: nobu <ko1@a...>
Date: Tue, 25 Aug 2015 14:12:04 +0900 (JST)
Subject: [ruby-changes:39596] nobu:r51677 (trunk): win32.c: fix offset

nobu	2015-08-25 14:11:35 +0900 (Tue, 25 Aug 2015)

  New Revision: 51677

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51677

  Log:
    win32.c: fix offset
    
    * win32/win32.c (opendir_internal): fix offset not to overwrite a
      backslash.

  Modified files:
    trunk/win32/win32.c
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 51676)
+++ win32/win32.c	(revision 51677)
@@ -1951,7 +1951,7 @@ opendir_internal(WCHAR *wpath, const cha https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L1951
 	    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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]