Changeset 1175
- Timestamp:
- Sep 8, 2008, 9:18:14 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/comp.c
r1157 r1175 54 54 16 Mar 08 GKY Prevent trap caused by files that exceed maxpath length 55 55 11 Jul 08 JBS Ticket 230: Simplified code and eliminated some local variables by incorporating 56 all the details view settings (both the global variables and those in the 57 DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. 56 all the details view settings (both the global variables and those in the 57 DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. 58 08 Sep 08 SHL Avoid aliased pszLongName pointer in ActionCnrThread IDM_MOVE 58 59 59 60 ***********************************************************************/ … … 80 81 #include "tmrsvcs.h" // IsITimerExpired 81 82 #include "comp.h" 82 #include "misc.h" 83 84 83 #include "misc.h" // AddToListboxBottom, AdjustCnrColRO, AdjustCnrColVis, AdjustCnrColsForPref 84 // AdjustDetailsSwitches, LoadDetailsSwitches, SetCnrCols 85 // SetDetailsSwitches 85 86 #include "select.h" // Deselect, InvertAll 86 87 #include "mkdir.h" // MassMkdir … … 88 89 #include "walkem.h" // WalkTwoCmpDlgProc 89 90 #include "fm3dll.h" 90 #include "notebook.h" 91 #include "notebook.h" // External compare/dircompare 91 92 92 93 #include "fortify.h" // 06 May 08 SHL … … 466 467 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 467 468 468 InitITimer(&itdSleep, 500); 469 InitITimer(&itdSleep, 500); // Sleep every 500 mSec 469 470 470 471 while (pciS && (INT)pciS != -1 && pciD && (INT)pciD != -1) { … … 552 553 pciD->pszDisplayName++; 553 554 } 554 // 02 Aug 07 SHL fixme to know if LongName transfer is correct?555 555 pciD->pszLongName = pciS->pszLongName; 556 pciS->pszLongName = NullStr; // 07 Sep 08 SHL avoid aliased pointer 556 557 if (pciD->pszSubject != NullStr) { 557 558 xfree(pciD->pszSubject, pszSrcFile, __LINE__); … … 631 632 pciS->pszFileName, szNewName); 632 633 if (rc == MBID_CANCEL) 633 pciNextS = NULL; 634 pciNextS = NULL; // Cause loop to break 634 635 } 635 636 else { … … 891 892 if (!*pciSa[x]->pszFileName || !*pciDa[x]->pszFileName) { 892 893 // 12 Jan 08 SHL clear flags 893 pciSa[x]->flags = 0; // File exists on one side only894 pciSa[x]->flags = 0; // File exists on one side only 894 895 pciDa[x]->flags = 0; 895 896 continue; … … 1319 1320 MPFROMP(pciDa), MPFROM2SHORT((min(numD, 65535)), 0)); 1320 1321 numS -= min(numS, 65535); 1321 SleepIfNeeded(&itdSleep, 0); 1322 SleepIfNeeded(&itdSleep, 0); // 12 Jan 08 SHL 1322 1323 } // while 1323 1324 } … … 1409 1410 else if (fForceLower) 1410 1411 strlwr(pffbFile->achName); 1411 1412 1412 memcpy(enddir, pffbFile->achName, pffbFile->cchName + 1); 1413 if (strlen(maskstr) > CCHMAXPATH) { 1413 1414 // Complain if pathnames exceeds max 1414 1415 DosFindClose(hDir); 1415 1416 1416 free(pffbArray); 1417 free(maskstr); 1417 1418 if (!fDone) { 1418 1419 fDone = TRUE; … … 1421 1422 GetPString(IDS_WARNINGTEXT), 1422 1423 "One or more of your files has a full path name that exceeds the OS/2 maximum"); 1423 1424 1424 } 1425 return; 1425 1426 } 1426 1427 if (AddToFileList(maskstr + skiplen, … … 1965 1966 } // if on both sides 1966 1967 1967 1968 if (x <= 0) { 1968 1969 free(filesl[l++]); // Done with item on left 1969 1970 1971 1972 1970 } 1971 if (x >= 0) { 1972 free(filesr[r++]); // Done with item on right 1973 } 1973 1974 // Ensure empty buffers point somewhere 1974 1975 if (!pcil->pszFileName) { … … 2019 2020 } 2020 2021 if (filesl) { 2021 2022 2023 2022 for(; filesl[l]; l++) { 2023 free(filesl[l]); 2024 } 2024 2025 } 2025 2026 if (pcir) { … … 2031 2032 } 2032 2033 if (filesr) { 2033 2034 2035 2034 for (; filesr[r]; r++) { 2035 free(filesr[r]); 2036 } 2036 2037 } 2037 2038 // Reduce count to match what is in containers … … 2039 2040 } // if insufficient resources 2040 2041 2041 xfree(filesl, pszSrcFile, __LINE__); 2042 xfree(filesl, pszSrcFile, __LINE__); // Free header - have already freed elements 2042 2043 filesl = NULL; 2043 2044 xfree(filesr, pszSrcFile, __LINE__); … … 2146 2147 WinSetWindowPtr(hwnd, QWL_USER, (PVOID)cmp); 2147 2148 { 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2149 SWP swp; 2150 ULONG size = sizeof(SWP); 2151 2152 PrfQueryProfileData(fmprof, FM3Str, "CompDir.Position", (PVOID) &swp, &size); 2153 WinSetWindowPos(hwnd, 2154 HWND_TOP, 2155 swp.x, 2156 swp.y, 2157 swp.cx, 2158 swp.cy, 2159 swp.fl); 2159 2160 } 2160 2161 SetCnrCols(hwndLeft, TRUE); … … 2676 2677 GetPString(IDS_COULDNTSTARTTHREADTEXT)); 2677 2678 WinDismissDlg(hwnd, 0); 2678 2679 # 2680 2681 # 2679 free(forthread); 2680 # ifdef FORTIFY 2681 Fortify_LeaveScope(); 2682 # endif 2682 2683 } 2683 2684 else { … … 2734 2735 WinSetDlgItemText(hwnd, COMP_NOTE, 2735 2736 GetPString(IDS_COMPHOLDFILTERINGTEXT)); 2736 // cmp->dcd.suspendview = 1; 2737 // cmp->dcd.suspendview = 1; // 12 Jan 08 SHL appears not to be used here 2737 2738 priority_idle(); // Don't hog resources 2738 2739 WinSendMsg(hwndLeft, CM_FILTER, MPFROMP(Filter), … … 2741 2742 MPFROMP(&cmp->dcd.mask)); 2742 2743 priority_normal(); 2743 // cmp->dcd.suspendview = 0; 2744 // cmp->dcd.suspendview = 0; // 12 Jan 08 SHL appears not to be used here 2744 2745 if (*cmp->dcd.mask.szMask) { 2745 2746 sprintf(s, … … 2759 2760 COMP_HIDENOTSELECTED); 2760 2761 2761 // cmp->dcd.suspendview = 1; 2762 // cmp->dcd.suspendview = 1; // 12 Jan 08 SHL appears not to be used here 2762 2763 if (wasHidden != 1) { 2763 2764 // Hide if not selected on both sides … … 2797 2798 MPFROMP(&cmp->dcd.mask)); 2798 2799 } 2799 // cmp->dcd.suspendview = 0; 2800 // cmp->dcd.suspendview = 0; // 12 Jan 08 SHL appears not to be used here 2800 2801 if (*cmp->dcd.mask.szMask) { 2801 2802 sprintf(s, … … 3074 3075 case DID_OK: 3075 3076 { 3076 3077 3078 3079 3080 3081 3077 SWP swp; 3078 ULONG size = sizeof(SWP); 3079 3080 WinQueryWindowPos(hwnd, &swp); 3081 PrfWriteProfileData(fmprof, FM3Str, "CompDir.Position", (PVOID) &swp, 3082 size); 3082 3083 } 3083 3084 WinDismissDlg(hwnd, 0); … … 3085 3086 case DID_CANCEL: 3086 3087 { 3087 3088 3089 3090 3091 3092 3088 SWP swp; 3089 ULONG size = sizeof(SWP); 3090 3091 WinQueryWindowPos(hwnd, &swp); 3092 PrfWriteProfileData(fmprof, FM3Str, "CompDir.Position", (PVOID) &swp, 3093 size); 3093 3094 } 3094 3095 WinDismissDlg(hwnd, 1);
Note:
See TracChangeset
for help on using the changeset viewer.