Skip to content

Commit 8da8756

Browse files
committed
backport 51e1da6 into 7.0
1 parent 21ac79e commit 8da8756

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Zend/zend_virtual_cwd.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,9 +899,12 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
899899
int bufindex = 0, isabsolute = 0;
900900
wchar_t * reparsetarget;
901901
BOOL isVolume = FALSE;
902+
#if VIRTUAL_CWD_DEBUG
902903
char printname[MAX_PATH];
904+
int printname_len;
905+
#endif
903906
char substitutename[MAX_PATH];
904-
int printname_len, substitutename_len;
907+
int substitutename_len;
905908
int substitutename_off = 0;
906909

907910
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
928931

929932
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
930933
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
934+
#if VIRTUAL_CWD_DEBUG
931935
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
932936
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
933937
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
940944
};
941945
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
942946
printname[printname_len] = 0;
947+
#endif
943948

944949
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
945950
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
955960
else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
956961
isabsolute = 1;
957962
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
963+
#if VIRTUAL_CWD_DEBUG
958964
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
959965
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
960966
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
965971
return -1;
966972
};
967973
printname[pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR)] = 0;
974+
#endif
968975

969976
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
970977
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,

0 commit comments

Comments
 (0)