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

ruby-changes:41632

From: nobu <ko1@a...>
Date: Mon, 1 Feb 2016 21:07:04 +0900 (JST)
Subject: [ruby-changes:41632] nobu:r53706 (trunk): win32.c: volume_prefix_len

nobu	2016-02-01 21:08:08 +0900 (Mon, 01 Feb 2016)

  New Revision: 53706

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

  Log:
    win32.c: volume_prefix_len
    
    * win32/win32.c (rb_w32_read_reparse_point): name the prefix
      length to be dropped.

  Modified files:
    trunk/win32/win32.c
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 53705)
+++ win32/win32.c	(revision 53706)
@@ -4843,13 +4843,13 @@ rb_w32_read_reparse_point(const WCHAR *p https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L4843
 	}
 	else { /* IO_REPARSE_TAG_MOUNT_POINT */
 	    static const WCHAR *volume = L"Volume{";
-	    /* +4/-4 means to drop "\??\" */
+	    enum {volume_prefix_len = rb_strlen_lit("\\??\\")};
 	    name = ((char *)rp->MountPointReparseBuffer.PathBuffer +
 		    rp->MountPointReparseBuffer.SubstituteNameOffset +
-		    4 * sizeof(WCHAR));
+		    volume_prefix_len * sizeof(WCHAR));
 	    ret = rp->MountPointReparseBuffer.SubstituteNameLength;
 	    *len = ret / sizeof(WCHAR);
-	    ret -= 4 * sizeof(WCHAR);
+	    ret -= volume_prefix_len * sizeof(WCHAR);
 	    if (ret > sizeof(volume) - 1 * sizeof(WCHAR) &&
 		memcmp(name, volume, sizeof(volume) - 1 * sizeof(WCHAR)) == 0)
 		return -1;

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

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