com php-src: backport 51e1da6ea1e663908302e162ced1b7a8cb5aee05 into 7.0: Zend/zend_virtual_cwd.c
| From: | Anatol Belski | Date: | Sat, 21 Jan 2017 01:56:15 +0000 |
| Subject: | com php-src: backport 51e1da6ea1e663908302e162ced1b7a8cb5aee05 into 7.0: Zend/zend_virtual_cwd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96825@lists.php.net to get a copy of this message | ||
Commit: 8da87563122e4d14208b2827fd6b2807578677ec
Author: Anatol Belski <ab@php.net> Sat, 21 Jan 2017 02:56:15 +0100
Parents: 21ac79e94bd0335bf885b807e09c4d86d75d776a
Branches: PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8da87563122e4d14208b2827fd6b2807578677ec
Log:
backport 51e1da6ea1e663908302e162ced1b7a8cb5aee05 into 7.0
Changed paths:
M Zend/zend_virtual_cwd.c
Diff:
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index ca19802..8e09078 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -899,9 +899,12 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t,
i
int bufindex = 0, isabsolute = 0;
wchar_t * reparsetarget;
BOOL isVolume = FALSE;
+#if VIRTUAL_CWD_DEBUG
char printname[MAX_PATH];
+ int printname_len;
+#endif
char substitutename[MAX_PATH];
- int printname_len, substitutename_len;
+ int substitutename_len;
int substitutename_off = 0;
if(++(*ll) > LINK_MAX) {
@@ -928,6 +931,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
+#if VIRTUAL_CWD_DEBUG
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
@@ -940,6 +944,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
};
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
printname[printname_len] = 0;
+#endif
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
@@ -955,6 +960,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
isabsolute = 1;
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
+#if VIRTUAL_CWD_DEBUG
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
@@ -965,6 +971,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
return -1;
};
printname[pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR)] = 0;
+#endif
substitutename_len = pbuffer->MountPointReparseBuffer..SubstituteNameLength / sizeof(WCHAR);
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,