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 @@ -597,15 +597,18 @@ SetCurrentPathOfWindow(LPWSTR szPath)
597597{
598598 HWND hwndActive = (HWND)SendMessage (hwndMDIClient, WM_MDIGETACTIVE, 0 , 0L );
599599
600- BOOL bOpenOnReplace = TRUE ;
600+ HWND hwndNew = nullptr ;
601601 if (ISUNCPATH (szPath))
602602 {
603603 // For UNC path this is the place of opening a new UNC window.
604604 // Use CTRL+W to remove the number-drive mapping and close it
605- AddUNCDrive (szPath);
606- bOpenOnReplace = FALSE ;
605+ DRIVE freeDriveFound = AddUNCDrive (szPath);
606+
607+ if (freeDriveFound)
608+ hwndNew = CreateDirWindow (szPath, FALSE , hwndActive);
607609 }
608- HWND hwndNew = CreateDirWindow (szPath, bOpenOnReplace, hwndActive);
610+ else
611+ hwndNew = CreateDirWindow (szPath, TRUE , hwndActive);
609612
610613 HWND hwndTree = HasTreeWindow (hwndNew);
611614 if (hwndTree)
Original file line number Diff line number Diff line change @@ -1630,7 +1630,7 @@ DRIVE FindUNCDrive(LPCTSTR path, PDWORD pdwFreeDriveSlot)
16301630 // Added an UNC drive which already existed
16311631 return dwDriveIndex ;
16321632
1633- // If we come across an empt yone , remember the first one
1633+ // If we come across an empty one , remember the first one
16341634 if (!aDriveInfo [dwDriveIndex ].szRoot [0 ] && !(* pdwFreeDriveSlot ))
16351635 * pdwFreeDriveSlot = dwDriveIndex ;
16361636 }
@@ -1641,7 +1641,7 @@ DRIVE AddUNCDrive(LPCTSTR path)
16411641{
16421642 DWORD dwFreeDriveSlot = 0 ;
16431643 DRIVE drive = FindUNCDrive (path , & dwFreeDriveSlot );
1644- if (!drive ){
1644+ if (!drive && dwFreeDriveSlot ){
16451645 // Havent't found an existing slot, so add new to first free found
16461646 lstrcpy (aDriveInfo [dwFreeDriveSlot ].szRoot , path );
16471647 lstrcpy (aDriveInfo [dwFreeDriveSlot ].szRootBackslash , path );
You can’t perform that action at this time.
0 commit comments