This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -612,7 +612,8 @@ SetCurrentPathOfWindow(LPWSTR szPath)
612612 switch (freeDriveFound)
613613 {
614614 case -1 :
615- // UNC Loop found. Throw your favourite messagebox here
615+ // UNC Loop found. e.g. \\foo\bar for existing drive \\foo\bar\share
616+ // Throw your favourite messagebox here
616617 break ;
617618
618619 case 0 :
Original file line number Diff line number Diff line change @@ -1624,8 +1624,16 @@ BOOL TypeAheadString(WCHAR ch, LPWSTR szT)
16241624BOOL FindUNCLoop (LPCTSTR path )
16251625{
16261626 for (DWORD dwDriveIndex = OFFSET_UNC ; dwDriveIndex < MAX_DRIVES ; ++ dwDriveIndex ) {
1627- if (aDriveInfo [dwDriveIndex ].szRoot [0 ] && StrStrIW (aDriveInfo [dwDriveIndex ].szRoot , path ))
1628- return TRUE;
1627+ if (aDriveInfo [dwDriveIndex ].szRoot [0 ] && StrStrIW (aDriveInfo [dwDriveIndex ].szRoot , path )) {
1628+
1629+ if (_wcsicmp (path , aDriveInfo [dwDriveIndex ].szRoot ))
1630+ // path a was a parent of an existing drive, e.g. \\foo\bar for \\foo\bar\share
1631+ // This is a loop, which can't be handled
1632+ return TRUE;
1633+ // else
1634+ // path is the same as an existing drive, e.g. \\foo\bar for \\foo\bar
1635+ // This is o ok
1636+ }
16291637 }
16301638 return FALSE;
16311639}
You can’t perform that action at this time.
0 commit comments