Changeset 1102
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/dircnrs.c
r1084 r1102 46 46 20 Jul 08 GKY Add save/append filename to clipboard. 47 47 Change menu wording to make these easier to find 48 02 Aug 08 GKY Always pass temp variable point to treecnr UM_SHOWME to avoid 49 freeing dcd->directory early 48 50 49 51 ***********************************************************************/ … … 781 783 } 782 784 if (fSwitchTree && hwndTree) { 785 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 786 783 787 if (hwndMain) { 784 if (TopWindow(hwndMain, (HWND) 0) == dcd->hwndFrame) 785 WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(dcd->directory), MPVOID); 786 } 787 else 788 WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(dcd->directory), MPVOID); 788 if (TopWindow(hwndMain, (HWND) 0) == dcd->hwndFrame && pszTempDir) 789 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 790 free(pszTempDir); 791 } 792 else { 793 if (pszTempDir) 794 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 795 free(pszTempDir); 796 } 789 797 } 790 798 dcd->firsttree = FALSE; … … 1334 1342 LastDir = hwnd; 1335 1343 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1336 if (fSwitchTreeOnFocus && hwndTree && dcd && *dcd->directory) 1337 WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(dcd->directory), MPVOID); 1344 if (fSwitchTreeOnFocus && hwndTree && dcd && *dcd->directory) { 1345 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 1346 1347 if (pszTempDir) { 1348 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 1349 free(pszTempDir); 1350 } 1351 } 1338 1352 } 1339 1353 break; … … 1843 1857 1844 1858 case IDM_FINDINTREE: 1845 if (hwndTree) 1846 WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(dcd->directory), 1847 MPFROMLONG(1L)); 1859 if (hwndTree) { 1860 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 1861 1862 if (pszTempDir) { 1863 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), 1864 MPFROMLONG(1L))) 1865 free(pszTempDir); 1866 } 1867 } 1848 1868 break; 1849 1869 -
trunk/dll/treecnr.c
r1079 r1102 46 46 15 Feb 08 SHL Sync with settings menu rework 47 47 15 Feb 08 SHL Avoid death if tree container 0 width 48 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory 49 02 Aug 08 GKY Always pass temp variable point to UM_SHOWME to avoid freeing pci->pszFileName early 48 50 49 51 ***********************************************************************/ … … 674 676 if (cnri.cRecords) { 675 677 sprintf(s, GetPString(IDS_NUMDRIVESTEXT), cnri.cRecords); 676 if (pci ) {678 if (pci && pci->pszFileName) { 677 679 if (!(driveflags[toupper(*pci->pszFileName) - 'A'] & 678 680 DRIVE_REMOVABLE) || … … 2354 2356 case IDM_FINDINTREE: 2355 2357 { 2356 CHAR dir[CCHMAXPATH];2358 PSZ pszTempDir; 2357 2359 PCNRITEM pci; 2358 2360 2359 2361 pci = (PCNRITEM) CurrentRecord(hwnd); 2360 2362 if (pci && (INT) pci != -1) { 2361 strcpy(dir, pci->pszFileName); 2362 MakeValidDir(dir); 2363 pszTempDir = xstrdup(pci->pszFileName, pszSrcFile, __LINE__); 2364 if (pszTempDir) 2365 MakeValidDir(pszTempDir); 2363 2366 } 2364 2367 else 2365 save_dir2(dir); 2366 if (WinDlgBox(HWND_DESKTOP, dcd->hwndParent, 2367 WalkAllDlgProc, 2368 FM3ModHandle, WALK_FRAME, MPFROMP(dir)) && *dir) 2369 WinSendMsg(hwnd, UM_SHOWME, MPFROMP(dir), MPFROMLONG(1)); 2368 pszTempDir = xstrdup(pFM2SaveDirectory, pszSrcFile, __LINE__); 2369 if (pszTempDir) { 2370 if (WinDlgBox(HWND_DESKTOP, dcd->hwndParent, 2371 WalkAllDlgProc, 2372 FM3ModHandle, WALK_FRAME, MPFROMP(pszTempDir))) { 2373 if (!WinSendMsg(hwnd, UM_SHOWME, MPFROMP(pszTempDir), MPFROMLONG(1))) 2374 free(pszTempDir); 2375 } 2376 else 2377 free(pszTempDir); 2378 } 2370 2379 } 2371 2380 break; … … 2440 2449 } 2441 2450 else 2442 s ave_dir2(newpath);2451 strcpy(newpath, pFM2SaveDirectory); 2443 2452 if (!WinDlgBox(HWND_DESKTOP, dcd->hwndParent, WalkAllDlgProc, 2444 2453 FM3ModHandle, WALK_FRAME,
Note:
See TracChangeset
for help on using the changeset viewer.