@@ -486,7 +486,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void)
486
486
static size_t tsrm_realpath_r (char * path , size_t start , size_t len , int * ll , time_t * t , int use_realpath , bool is_dir , int * link_is_dir ) /* {{{ */
487
487
{
488
488
size_t i , j ;
489
- int directory = 0 , save ;
489
+ int directory = 0 , save , may_retry_reparse_point ;
490
490
#ifdef ZEND_WIN32
491
491
WIN32_FIND_DATAW dataw ;
492
492
HANDLE hFind = INVALID_HANDLE_VALUE ;
@@ -591,6 +591,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
591
591
592
592
#ifdef ZEND_WIN32
593
593
retry_reparse_point :
594
+ may_retry_reparse_point = 0 ;
594
595
if (save ) {
595
596
pathw = php_win32_ioutil_any_to_w (path );
596
597
if (!pathw ) {
@@ -685,6 +686,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
685
686
CloseHandle (hLink );
686
687
687
688
if (pbuffer -> ReparseTag == IO_REPARSE_TAG_SYMLINK ) {
689
+ may_retry_reparse_point = 1 ;
688
690
reparsetarget = pbuffer -> SymbolicLinkReparseBuffer .ReparseTarget ;
689
691
isabsolute = pbuffer -> SymbolicLinkReparseBuffer .Flags == 0 ;
690
692
#if VIRTUAL_CWD_DEBUG
@@ -821,7 +823,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
821
823
free_alloca (pbuffer , use_heap_large );
822
824
free (substitutename );
823
825
824
- {
826
+ if ( may_retry_reparse_point ) {
825
827
DWORD attrs ;
826
828
827
829
FREE_PATHW ()
0 commit comments