- Timestamp:
- Dec 31, 2007, 12:34:00 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HISTORY
r888 r897 2 2 3 3 3.09(pre) 4 o Add TestFDate and TestCDate for date compare and sort functions (Gregg) 5 o Use commaFMTULL for formating additional file, EA etc size information(Gregg) 6 o Give LIBPATHSTRICT option for mailto & run FTP/HTTP (Gregg) 7 o Add "mailto" option in new viewer (Gregg) 4 8 o Make WPURLDEFAULTSETTINGS the fall back for ftp/httprun (Gregg) 5 9 o Update CopyPresParams to copy all types of pres parameters (Gregg) 6 10 o Add "Save as" menu item to internal viewer (Gregg) 7 11 o Eliminate deletion of ext path if it was not valid on startup 8 allow saving of a currently not valid ext path with warning (Gregg)12 o Allow saving of a currently not valid ext path with warning (Gregg) 9 13 o Internal editor now handles readonly files (Gregg) 10 14 o Correct hex edit buffer sizing to avoid data loss (Steven) -
trunk/dll/arccnrs.c
r888 r897 48 48 26 Aug 07 GKY DosSleep(1) in loops changed to (0) 49 49 22 Nov 07 GKY Use CopyPresParams to fix presparam inconsistencies in menus 50 30 Dec 07 GKY Use TestCDates for sort by date 50 51 51 52 ***********************************************************************/ … … 269 270 270 271 case SORT_LWDATE: 271 ret = (pai1->date.year < pai2->date.year) ? 1 : 272 ret = TestCDates(&pai1->date, &pai1->time, 273 &pai2->date, &pai2->time); 274 /*(pai1->date.year < pai2->date.year) ? 1 : 272 275 (pai1->date.year > pai2->date.year) ? -1 : 273 276 (pai1->date.month < pai2->date.month) ? 1 : … … 280 283 (pai1->time.minutes > pai2->time.minutes) ? -1 : 281 284 (pai1->time.seconds < pai2->time.seconds) ? 1 : 282 (pai1->time.seconds > pai2->time.seconds) ? -1 : 0; 285 (pai1->time.seconds > pai2->time.seconds) ? -1 : 0;*/ 283 286 break; 284 287 -
trunk/dll/autoview.c
r872 r897 22 22 27 Sep 07 SHL Correct ULONGLONG size formatting 23 23 22 Nov 07 GKY Use CopyPresParams to fix presparam inconsistencies in menus 24 30 Dec 07 GKY Use CommaFmtULL 24 25 25 26 ***********************************************************************/ … … 420 421 421 422 static FILEFINDBUF4L ffb[130]; 422 CHAR fullname[CCHMAXPATH + 4] ;423 CHAR fullname[CCHMAXPATH + 4], szCmmaFmtFileSize[81]; 423 424 HDIR hdir = HDIR_CREATE; 424 425 ULONG x, nm, ml, mc, bufflen; … … 472 473 (pffbFile->achName[1] == '.' && 473 474 !pffbFile->achName[2]))))) { 474 // 27 Sep 07 SHL fixme to use CommaFmtULL 475 CommaFmtULL(szCmmaFmtFileSize, 476 sizeof(szCmmaFmtFileSize), 477 pffbFile->cbFile + CBLIST_TO_EASIZE(pffbFile->cbList), 478 ' '); 475 479 sprintf(p, 476 "%s%-*.*s %-8 llu[%s%s%s%s] %04lu/%02lu/%02lu "480 "%s%-*.*s %-8s [%s%s%s%s] %04lu/%02lu/%02lu " 477 481 "%02lu:%02lu:%02lu\r", 478 482 pffbFile->attrFile & FILE_DIRECTORY ? "\\" : " ", 479 483 ml, 480 484 ml, 481 pffbFile->achName, 482 pffbFile->cbFile + 483 CBLIST_TO_EASIZE(pffbFile->cbList), 485 pffbFile->achName, 486 szCmmaFmtFileSize, 484 487 pffbFile->attrFile & FILE_READONLY ? "R" : "-", 485 488 pffbFile->attrFile & FILE_ARCHIVED ? "A" : "-", -
trunk/dll/comp.c
r888 r897 39 39 26 Aug 07 GKY DosSleep(1) in loops changed to (0) 40 40 27 Sep 07 SHL Correct ULONGLONG size formatting 41 30 Dec 07 GKY Use TestCDates for compare by file date/time 41 42 42 43 ***********************************************************************/ … … 931 932 INT numallocl = 0; 932 933 INT numallocr = 0; 934 INT ret = 0; 933 935 UINT lenl; // Directory prefix length 934 936 UINT lenr; … … 1289 1291 strcpy(pch, GetPString(IDS_SMALLERTEXT)); 1290 1292 pch += 7; 1291 } 1292 if ((pcil->date.year > pcir->date.year) ? TRUE : 1293 } 1294 ret = TestCDates(&pcir->date, &pcir->time, 1295 &pcil->date, &pcil->time); 1296 if (ret == 1) 1297 /*((pcil->date.year > pcir->date.year) ? TRUE : 1293 1298 (pcil->date.year < pcir->date.year) ? FALSE : 1294 1299 (pcil->date.month > pcir->date.month) ? TRUE : … … 1301 1306 (pcil->time.minutes < pcir->time.minutes) ? FALSE : 1302 1307 (pcil->time.seconds > pcir->time.seconds) ? TRUE : 1303 (pcil->time.seconds < pcir->time.seconds) ? FALSE : FALSE) {1308 (pcil->time.seconds < pcir->time.seconds) ? FALSE : FALSE)*/ { 1304 1309 pcil->flags |= CNRITEM_NEWER; 1305 1310 pcir->flags |= CNRITEM_OLDER; … … 1311 1316 pch += 5; 1312 1317 } 1313 else if ((pcil->date.year < pcir->date.year) ? TRUE : 1318 else if (ret == -1) 1319 /*((pcil->date.year < pcir->date.year) ? TRUE : 1314 1320 (pcil->date.year > pcir->date.year) ? FALSE : 1315 1321 (pcil->date.month < pcir->date.month) ? TRUE : … … 1323 1329 (pcil->time.seconds < pcir->time.seconds) ? TRUE : 1324 1330 (pcil->time.seconds > pcir->time.seconds) ? FALSE : 1325 FALSE) {1331 FALSE)*/ { 1326 1332 pcil->flags |= CNRITEM_OLDER; 1327 1333 pcir->flags |= CNRITEM_NEWER; -
trunk/dll/fm3dll.str
r892 r897 843 843 Dropping here can change the icon of the object. 844 844 FM/2: Drive flags (drive %c:) 845 % llub + %lub EAs = %llub (%luk) total845 %s + %s EAs = %s (%s) total 846 846 PATH DPATH LIBPATH HELP BOOKSHELF LIB INCLUDE LOCPATH SMINCLUDE LPATH CODELPATH 847 847 %%Environment%% -
trunk/dll/info.c
r850 r897 23 23 25 Aug 07 SHL IconProc: do not use freed memory - random bad things happen 24 24 27 Sep 07 SHL Correct ULONGLONG size formatting 25 30 Dec 07 GKY Use CommaFmtULL 25 26 26 27 ***********************************************************************/ … … 624 625 if (pfs && *pfs->szFileName) { 625 626 CHAR s[97]; 627 CHAR szCmmaFmtFileSize[81], szCmmaFmtEASize[81]; 628 CHAR szCmmaFmtFileEASize[81], szCmmaFmtFileEASizeK[81]; 626 629 FILEFINDBUF4L fs; 627 630 HDIR hdir = HDIR_CREATE; … … 693 696 WinSetDlgItemText(hwnd, FLE_LASTACCESS, s); 694 697 } 695 // 27 Sep 07 SHL fixme to use CommaFmtULL 696 // 27 Sep 07 SHL fixme to not format numbers in IDS_SIZEINCLEASTEXT 698 CommaFmtULL(szCmmaFmtFileSize, 699 sizeof(szCmmaFmtFileSize), fs.cbFile, ' '); 700 CommaFmtULL(szCmmaFmtEASize, 701 sizeof(szCmmaFmtEASize), CBLIST_TO_EASIZE(fs.cbList), ' '); 702 CommaFmtULL(szCmmaFmtFileEASize, 703 sizeof(szCmmaFmtFileEASize), 704 fs.cbFile + CBLIST_TO_EASIZE(fs.cbList), 705 ' '); 706 CommaFmtULL(szCmmaFmtFileEASizeK, 707 sizeof(szCmmaFmtFileEASizeK), 708 fs.cbFile + CBLIST_TO_EASIZE(fs.cbList), 709 'K'); 697 710 sprintf(s, 698 711 GetPString(IDS_SIZEINCLEASTEXT), 699 fs.cbFile,700 CBLIST_TO_EASIZE(fs.cbList),701 fs.cbFile + CBLIST_TO_EASIZE(fs.cbList),702 (ULONG)((fs.cbFile + CBLIST_TO_EASIZE(fs.cbList)) / 1024));712 szCmmaFmtFileSize, 713 szCmmaFmtEASize, 714 szCmmaFmtFileEASize, 715 szCmmaFmtFileEASizeK); 703 716 WinSetDlgItemText(hwnd, FLE_SIZES, s); 704 // 27 Sep 07 SHL fixme to use CommaFmtULL 705 sprintf(s, "%llub", fs.cbFileAlloc - fs.cbFile); 717 CommaFmtULL(szCmmaFmtFileSize, 718 sizeof(szCmmaFmtFileSize), fs.cbFileAlloc - fs.cbFile, ' '); 719 sprintf(s, "%s", szCmmaFmtFileSize); 706 720 WinSetDlgItemText(hwnd, FLE_SLACK, s); 707 721 WinCheckButton(hwnd, -
trunk/dll/rename.c
r846 r897 12 12 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 13 13 27 Sep 07 SHL Correct ULONGLONG size formatting 14 30 Dec 07 GKY Use TestFDates for comparing dates 14 15 15 16 ***********************************************************************/ … … 75 76 76 77 FILESTATUS3L fs1, fs2; 77 CHAR s[CCHMAXPATH * 2], *p, chkname[CCHMAXPATH] ;78 CHAR s[CCHMAXPATH * 2], *p, chkname[CCHMAXPATH], szCmmaFmtFileSize[81]; 78 79 INT sourceexists = 0, targetexists = 0, 79 80 sourcenewer = 0, sourcesmaller = 0; … … 90 91 WinSetDlgItemText(hwnd, REN_SOURCE, mv->source); 91 92 if (!DosQueryPathInfo(mv->source, FIL_STANDARDL, &fs1, sizeof(fs1))) { 92 // 27 Sep 07 SHL fixme to use CommaFmtULL 93 CommaFmtULL(szCmmaFmtFileSize, 94 sizeof(szCmmaFmtFileSize), fs1.cbFile, ' '); 93 95 sprintf(s, 94 " %s% llu%ss %04u/%02u/%02u %02u:%02u:%02u",96 " %s%s %ss %04u/%02u/%02u %02u:%02u:%02u", 95 97 fs1.attrFile & FILE_DIRECTORY ? 96 98 GetPString(IDS_DIRBRKTTEXT) : NullStr, 97 fs1.cbFile,99 szCmmaFmtFileSize, 98 100 GetPString(IDS_BYTETEXT), 99 101 fs1.fdateLastWrite.year + 1980, … … 117 119 } 118 120 if (!DosQueryPathInfo(chkname, FIL_STANDARDL, &fs2, sizeof(fs2))) { 119 // 27 Sep 07 SHL fixme to use CommaFmtULL 121 CommaFmtULL(szCmmaFmtFileSize, 122 sizeof(szCmmaFmtFileSize), fs2.cbFile, ' '); 120 123 sprintf(s, 121 " %s% llu%ss %04u/%02u/%02u %02u:%02u:%02u",124 " %s%s %ss %04u/%02u/%02u %02u:%02u:%02u", 122 125 fs2.attrFile & FILE_DIRECTORY ? 123 126 GetPString(IDS_DIRBRKTTEXT) : NullStr, 124 fs2.cbFile,127 szCmmaFmtFileSize, 125 128 GetPString(IDS_BYTETEXT), 126 129 fs2.fdateLastWrite.year + 1980, … … 169 172 170 173 if (targetexists == 1 && sourceexists == 1) { 171 sourcenewer = 172 (fs1.fdateLastWrite.year < fs2.fdateLastWrite.year) ? 1 : 173 (fs1.fdateLastWrite.year > fs2.fdateLastWrite.year) ? -1 : 174 (fs1.fdateLastWrite.month < fs2.fdateLastWrite.month) ? 1 : 175 (fs1.fdateLastWrite.month > fs2.fdateLastWrite.month) ? -1 : 176 (fs1.fdateLastWrite.day < fs2.fdateLastWrite.day) ? 1 : 177 (fs1.fdateLastWrite.day > fs2.fdateLastWrite.day) ? -1 : 178 (fs1.ftimeLastWrite.hours < fs2. ftimeLastWrite. hours) ? 1 : 179 (fs1.ftimeLastWrite.hours > fs2.ftimeLastWrite.hours) ? -1 : 180 (fs1.ftimeLastWrite.minutes < fs2.ftimeLastWrite.minutes) ? 1 : 181 (fs1.ftimeLastWrite.minutes > fs2.ftimeLastWrite.minutes) ? -1 : 182 (fs1.ftimeLastWrite.twosecs < fs2.ftimeLastWrite.twosecs) ? 1 : 183 (fs1.ftimeLastWrite.twosecs > fs2.ftimeLastWrite.twosecs) ? -1 : 0; 174 sourcenewer = TestFDates(NULL, NULL, 175 &fs1.fdateLastWrite, &fs1.ftimeLastWrite, 176 &fs2.fdateLastWrite, &fs2.ftimeLastWrite); 184 177 sourcesmaller = (fs1.cbFile < fs2.cbFile) ? -1 : 185 (fs1.cbFile > fs2.cbFile) ? 1 : 186 0; 178 (fs1.cbFile > fs2.cbFile) ? 1 : 0; 187 179 sprintf(&s[strlen(s)], GetPString(IDS_SOURCEISTEXT), 188 180 (sourcenewer == -1) ? GetPString(IDS_NEWERTEXT) : -
trunk/dll/saveclip.c
r871 r897 20 20 27 Sep 07 SHL Correct ULONGLONG size formatting 21 21 16 Nov 07 SHL Ensure fixup buffer sufficiently large 22 30 Dec 07 GKY Use CommaFmtULL 22 23 23 24 ***********************************************************************/ … … 356 357 PCNRITEM pci; 357 358 FILE *fp; 358 CHAR *p, *pp, temp; 359 CHAR *p, *pp, temp; 360 CHAR szCmmaFmtFileSize[81]; 359 361 INT attribute = CRA_CURSORED; 360 362 SHORT sSelect; … … 453 455 break; 454 456 case 'Z': 455 // 27 Sep 07 SHL fixme to use CommaFmtULL? 456 fprintf(fp, "%-13llu", pci->cbFile); 457 CommaFmtULL(szCmmaFmtFileSize, 458 sizeof(szCmmaFmtFileSize), pci->cbFile, ' '); 459 fprintf(fp, "%-13s", szCmmaFmtFileSize); 457 460 break; 458 461 case 'z': 459 // 27 Sep 07 SHL fixme to use CommaFmtULL? 460 fprintf(fp, "%llu", pci->cbFile); 462 CommaFmtULL(szCmmaFmtFileSize, 463 sizeof(szCmmaFmtFileSize), pci->cbFile, ' '); 464 fprintf(fp, "%s", szCmmaFmtFileSize); 461 465 break; 462 466 case 'E': … … 848 852 PGEA2 pgea; 849 853 PFEA2 pfea; 850 CHAR *value; 854 CHAR *value; 855 851 856 852 857 pgealist = … … 887 892 if (*p == '%') { 888 893 p++; 889 switch (*p) { 894 switch (*p) { 895 CHAR szCmmaFmtFileSize[81]; 890 896 case 's': 891 897 fputs(subject, fp); … … 895 901 break; 896 902 case 'Z': 897 // 27 Sep 07 SHL fixme to use CommaFmtULL? 898 fprintf(fp, "%-13llu", ffb4.cbFile); 903 CommaFmtULL(szCmmaFmtFileSize, 904 sizeof(szCmmaFmtFileSize), ffb4.cbFile, ' '); 905 fprintf(fp, "%-13s", szCmmaFmtFileSize); 899 906 break; 900 907 case 'z': 901 // 27 Sep 07 SHL fixme to use CommaFmtULL? 902 fprintf(fp, "%llu", ffb4.cbFile); 908 CommaFmtULL(szCmmaFmtFileSize, 909 sizeof(szCmmaFmtFileSize), ffb4.cbFile, ' '); 910 fprintf(fp, "%s", szCmmaFmtFileSize); 903 911 break; 904 912 case 'E': -
trunk/dll/seeall.c
r888 r897 31 31 26 Aug 07 GKY DosSleep(1) in loops changed to (0) 32 32 27 Sep 07 SHL Correct ULONGLONG size formatting 33 30 Dec 07 GKY Use CommaFmtULL 34 30 Dec 07 GKY Use TestFDates for comparing by date 33 35 34 36 ***********************************************************************/ … … 1572 1574 int ret; 1573 1575 1574 ret = (d1->date.year > d2->date.year) ? 1 : 1576 ret = TestFDates(NULL, NULL, 1577 &d2->date, &d2->time, 1578 &d1->date, &d1->time); 1579 /*(d1->date.year > d2->date.year) ? 1 : 1575 1580 (d1->date.year < d2->date.year) ? -1 : 1576 1581 (d1->date.month > d2->date.month) ? 1 : … … 1583 1588 (d1->time.minutes < d2->time.minutes) ? -1 : 1584 1589 (d1->time.twosecs > d2->time.twosecs) ? 1 : 1585 (d1->time.twosecs < d2->time.twosecs) ? -1 : 0; 1590 (d1->time.twosecs < d2->time.twosecs) ? -1 : 0;*/ 1586 1591 1587 1592 if (!ret) … … 2228 2233 ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER); 2229 2234 POINTL ptl; 2230 CHAR szBuff[CCHMAXPATH + 80] ;2235 CHAR szBuff[CCHMAXPATH + 80], szCmmaFmtFileSize[81]; 2231 2236 ULONG len, y; 2232 2237 … … 2262 2267 standardcolors[Colors[COLORS_NORMALBACK]]); 2263 2268 } 2264 // 27 Sep 07 SHL fixme to use CommaFmtULL 2269 CommaFmtULL(szCmmaFmtFileSize, 2270 sizeof(szCmmaFmtFileSize), ad->afindex[y]->cbFile, ' '); 2265 2271 len = sprintf(szBuff, 2266 "%c%-*.*s %-12 llu%c%c%c%c%c %04u/%02u/%02u %02u:%02u:%02u ",2272 "%c%-*.*s %-12s %c%c%c%c%c %04u/%02u/%02u %02u:%02u:%02u ", 2267 2273 whichfile == ad->cursored - 1 ? '>' : ' ', 2268 2274 ad->fullnames ? ad->longestw : ad->longest, … … 2270 2276 ad->fullnames ? ad->afindex[y]->fullname : 2271 2277 ad->afindex[y]->filename, 2272 ad->afindex[y]->cbFile,2278 szCmmaFmtFileSize, 2273 2279 "-A"[((ad->afindex[y]->attrFile & FILE_ARCHIVED) != 0)], 2274 2280 "-R"[((ad->afindex[y]->attrFile & FILE_READONLY) != 0)], … … 3345 3351 register ULONG x; 3346 3352 ULONG y, len, numlines; 3347 CHAR szBuff[CCHMAXPATH + 80] ;3353 CHAR szBuff[CCHMAXPATH + 80], szCmmaFmtFileSize[81]; 3348 3354 BOOL inverted, hidsys, reado, wascursored; 3349 3355 … … 3432 3438 standardcolors[Colors 3433 3439 [COLORS_CURSOREDNORMALBACK]]); 3434 // 27 Sep 07 SHL fixme to use CommaFmtULL 3440 CommaFmtULL(szCmmaFmtFileSize, 3441 sizeof(szCmmaFmtFileSize), pAD->afindex[y]->cbFile, ' '); 3435 3442 len = 3436 3443 sprintf(szBuff, 3437 "%c%-*.*s %-12 llu%c%c%c%c%c %04u/%02u/%02u %02u:%02u:%02u ",3444 "%c%-*.*s %-12s %c%c%c%c%c %04u/%02u/%02u %02u:%02u:%02u ", 3438 3445 wascursored ? '>' : ' ', 3439 3446 pAD->fullnames ? pAD->longestw : pAD->longest, 3440 3447 pAD->fullnames ? pAD->longestw : pAD->longest, 3441 3448 (pAD->fullnames) ? pAD->afindex[y]->fullname : pAD-> 3442 afindex[y]->filename, pAD->afindex[y]->cbFile,3449 afindex[y]->filename, szCmmaFmtFileSize, 3443 3450 "-A"[((pAD->afindex[y]->attrFile & FILE_ARCHIVED) != 3444 3451 0)], -
trunk/dll/select.c
r847 r897 585 585 BOOL slow = FALSE; 586 586 UINT x, numD, numS; 587 INT ret = 0; 587 588 588 589 if (!hwndCnrS || !hwndCnrD) { … … 701 702 pciDa[x]->flags |= CNRITEM_LARGER; 702 703 } 703 if ((pciSa[x]->date.year > pciDa[x]->date.year) ? TRUE : 704 ret = TestCDates(&pciDa[x]->date, &pciDa[x]->time, 705 &pciSa[x]->date, &pciSa[x]->time); 706 if (ret == 1) 707 /*((pciSa[x]->date.year > pciDa[x]->date.year) ? TRUE : 704 708 (pciSa[x]->date.year < pciDa[x]->date.year) ? FALSE : 705 709 (pciSa[x]->date.month > pciDa[x]->date.month) ? TRUE : … … 712 716 (pciSa[x]->time.minutes < pciDa[x]->time.minutes) ? FALSE : 713 717 (pciSa[x]->time.seconds > pciDa[x]->time.seconds) ? TRUE : 714 (pciSa[x]->time.seconds < pciDa[x]->time.seconds) ? FALSE : FALSE) {718 (pciSa[x]->time.seconds < pciDa[x]->time.seconds) ? FALSE : FALSE)*/ { 715 719 pciSa[x]->flags |= CNRITEM_NEWER; 716 720 pciDa[x]->flags |= CNRITEM_OLDER; 717 721 } 718 else if ((pciSa[x]->date.year < pciDa[x]->date.year) ? TRUE : 722 else if (ret == -1) 723 /*((pciSa[x]->date.year < pciDa[x]->date.year) ? TRUE : 719 724 (pciSa[x]->date.year > pciDa[x]->date.year) ? FALSE : 720 725 (pciSa[x]->date.month < pciDa[x]->date.month) ? TRUE : … … 728 733 (pciSa[x]->time.seconds < pciDa[x]->time.seconds) ? TRUE : 729 734 (pciSa[x]->time.seconds > pciDa[x]->time.seconds) ? FALSE : 730 FALSE) {735 FALSE)*/ { 731 736 pciSa[x]->flags |= CNRITEM_OLDER; 732 737 pciDa[x]->flags |= CNRITEM_NEWER; … … 1187 1192 HENUM henum; 1188 1193 HWND hwnd; 1189 register INT numwindows = 0, w, x, z, cmp;1194 INT numwindows = 0, w, x, z, cmp = 0; 1190 1195 struct Cnr *Cnrs = NULL; 1191 1196 struct SS *bsres; … … 1277 1282 bsres->pci->cbFile + bsres->pci->easize) 1278 1283 Cnrs[z].ss[x].largest = FALSE; 1279 cmp = 1280 (Cnrs[z].ss[x].pci->date.year > 1284 cmp = TestCDates(&bsres->pci->date, &bsres->pci->time, 1285 &Cnrs[z].ss[x].pci->date, &Cnrs[z].ss[x].pci->time); 1286 /*(Cnrs[z].ss[x].pci->date.year > 1281 1287 bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year < 1282 1288 bsres->pci->date. … … 1311 1317 seconds < 1312 1318 bsres->pci->time. 1313 seconds) ? FALSE : FALSE; 1314 if ( !cmp)1319 seconds) ? FALSE : FALSE;*/ 1320 if (cmp != 1) 1315 1321 Cnrs[z].ss[x].newest = FALSE; 1316 cmp =1322 /*cmp = 1317 1323 (Cnrs[z].ss[x].pci->date.year < 1318 1324 bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year > … … 1348 1354 seconds > 1349 1355 bsres->pci->time. 1350 seconds) ? FALSE : FALSE; 1351 if ( !cmp)1356 seconds) ? FALSE : FALSE;*/ 1357 if (cmp != -1) 1352 1358 Cnrs[z].ss[x].oldest = FALSE; 1353 1359 cmp = 0; -
trunk/dll/sortcnr.c
r793 r897 142 142 143 143 case SORT_LWDATE: 144 ret = (pCI1->date.year < pCI2->date.year) ? 1 : 144 ret = TestCDates(&pCI1->date, &pCI1->time, 145 &pCI2->date, &pCI2->time); 146 /*(pCI1->date.year < pCI2->date.year) ? 1 : 145 147 (pCI1->date.year > pCI2->date.year) ? -1 : 146 148 (pCI1->date.month < pCI2->date.month) ? 1 : … … 153 155 (pCI1->time.minutes > pCI2->time.minutes) ? -1 : 154 156 (pCI1->time.seconds < pCI2->time.seconds) ? 1 : 155 (pCI1->time.seconds > pCI2->time.seconds) ? -1 : 0; 157 (pCI1->time.seconds > pCI2->time.seconds) ? -1 : 0;*/ 156 158 break; 157 159 158 160 case SORT_LADATE: 159 ret = (pCI1->ladate.year < pCI2->ladate.year) ? 1 : 161 ret = TestCDates(&pCI1->ladate, &pCI1->latime, 162 &pCI2->ladate, &pCI2->latime); 163 /*(pCI1->ladate.year < pCI2->ladate.year) ? 1 : 160 164 (pCI1->ladate.year > pCI2->ladate.year) ? -1 : 161 165 (pCI1->ladate.month < pCI2->ladate.month) ? 1 : … … 168 172 (pCI1->latime.minutes > pCI2->latime.minutes) ? -1 : 169 173 (pCI1->latime.seconds < pCI2->latime.seconds) ? 1 : 170 (pCI1->latime.seconds > pCI2->latime.seconds) ? -1 : 0; 174 (pCI1->latime.seconds > pCI2->latime.seconds) ? -1 : 0;*/ 171 175 break; 172 176 173 177 case SORT_CRDATE: 174 ret = (pCI1->crdate.year < pCI2->crdate.year) ? 1 : 178 ret = TestCDates(&pCI1->crdate, &pCI1->crtime, 179 &pCI2->crdate, &pCI2->crtime); 180 /*(pCI1->crdate.year < pCI2->crdate.year) ? 1 : 175 181 (pCI1->crdate.year > pCI2->crdate.year) ? -1 : 176 182 (pCI1->crdate.month < pCI2->crdate.month) ? 1 : … … 183 189 (pCI1->crtime.minutes > pCI2->crtime.minutes) ? -1 : 184 190 (pCI1->crtime.seconds < pCI2->crtime.seconds) ? 1 : 185 (pCI1->crtime.seconds > pCI2->crtime.seconds) ? -1 : 0; 191 (pCI1->crtime.seconds > pCI2->crtime.seconds) ? -1 : 0;*/ 186 192 break; 187 193 } -
trunk/dll/valid.c
r850 r897 24 24 16 Jun 07 SHL Update for OpenWatcom 25 25 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 26 30 Dec 07 GKY Change TestDates to TestFDates can compare by filename or FDATE/FTIME data 27 30 Dec 07 GKY Add TestCDates to compare CNRITEMs by CDATE/CTIME data 26 28 27 29 ***********************************************************************/ … … 78 80 } 79 81 80 int TestDates(char *file1, char *file2) 82 int TestFDates(char *file1, char *file2, FDATE *datevar1, FTIME *timevar1, 83 FDATE *datevar2, FTIME *timevar2) 84 { 85 /* 86 * return 1 (file2 newer than file1), 87 * 0 (files same) 88 * or -1 (file1 newer than file2) 89 * Make the FILSTATUS pointers NULL if passing file names 90 * if the FILESTATUS information is already available it can be passed instead 91 * Make the files NULL if passing FILESTATUS buffers 92 */ 93 94 int comp = 0; 95 FILESTATUS3 fs3o, fs3n; 96 97 if (file1){ 98 DosError(FERR_DISABLEHARDERR); 99 DosQueryPathInfo(file1, FIL_STANDARD, &fs3o, sizeof(fs3o)); 100 datevar1 = &fs3o.fdateLastWrite; 101 timevar1 = &fs3o.ftimeLastWrite; 102 } 103 if (file2) { 104 DosError(FERR_DISABLEHARDERR); 105 DosQueryPathInfo(file2, FIL_STANDARD, &fs3n, sizeof(fs3n)); 106 datevar2 = &fs3n.fdateLastWrite; 107 timevar2 = &fs3n.ftimeLastWrite; 108 } 109 if (&datevar1 && &datevar2 && &timevar1 && &timevar2) { 110 comp = (datevar2->year > 111 datevar1->year) ? 1 : 112 (datevar2->year < 113 datevar1->year) ? -1 : 114 (datevar2->month > 115 datevar1->month) ? 1 : 116 (datevar2->month < 117 datevar1->month) ? -1 : 118 (datevar2->day > 119 datevar1->day) ? 1 : 120 (datevar2->day < 121 datevar1->day) ? -1 : 122 (timevar2->hours > 123 timevar1->hours) ? 1 : 124 (timevar2->hours < 125 timevar1->hours) ? -1 : 126 (timevar2->minutes > 127 timevar1->minutes) ? 1 : 128 (timevar2->minutes < 129 timevar1->minutes) ? -1 : 130 (timevar2->twosecs > 131 timevar1->twosecs) ? 1 : 132 (timevar2->twosecs < timevar1->twosecs) ? -1 : 0; 133 } 134 return comp; 135 } 136 137 int TestCDates(CDATE *datevar1, CTIME *timevar1, 138 CDATE *datevar2, CTIME *timevar2) 81 139 { 82 140 /* … … 87 145 88 146 int comp = 0; 89 FILESTATUS3 fs3o, fs3n; 90 91 DosError(FERR_DISABLEHARDERR); 92 if (!DosQueryPathInfo(file1, FIL_STANDARD, &fs3o, sizeof(fs3o))) { 93 DosError(FERR_DISABLEHARDERR); 94 if (!DosQueryPathInfo(file2, FIL_STANDARD, &fs3n, sizeof(fs3n))) { 95 comp = (fs3n.fdateLastWrite.year > 96 fs3o.fdateLastWrite.year) ? 1 : 97 (fs3n.fdateLastWrite.year < 98 fs3o.fdateLastWrite.year) ? -1 : 99 (fs3n.fdateLastWrite.month > 100 fs3o.fdateLastWrite.month) ? 1 : 101 (fs3n.fdateLastWrite.month < 102 fs3o.fdateLastWrite.month) ? -1 : 103 (fs3n.fdateLastWrite.day > 104 fs3o.fdateLastWrite.day) ? 1 : 105 (fs3n.fdateLastWrite.day < 106 fs3o.fdateLastWrite.day) ? -1 : 107 (fs3n.ftimeLastWrite.hours > 108 fs3o.ftimeLastWrite.hours) ? 1 : 109 (fs3n.ftimeLastWrite.hours < 110 fs3o.ftimeLastWrite.hours) ? -1 : 111 (fs3n.ftimeLastWrite.minutes > 112 fs3o.ftimeLastWrite.minutes) ? 1 : 113 (fs3n.ftimeLastWrite.minutes < 114 fs3o.ftimeLastWrite.minutes) ? -1 : 115 (fs3n.ftimeLastWrite.twosecs > 116 fs3o.ftimeLastWrite.twosecs) ? 1 : 117 (fs3n.ftimeLastWrite.twosecs < fs3o.ftimeLastWrite.twosecs) ? -1 : 0; 118 } 119 } 120 return comp; 147 148 if (&datevar1 && &datevar2 && &timevar1 && &timevar2) { 149 comp = (datevar2->year > 150 datevar1->year) ? 1 : 151 (datevar2->year < 152 datevar1->year) ? -1 : 153 (datevar2->month > 154 datevar1->month) ? 1 : 155 (datevar2->month < 156 datevar1->month) ? -1 : 157 (datevar2->day > 158 datevar1->day) ? 1 : 159 (datevar2->day < 160 datevar1->day) ? -1 : 161 (timevar2->hours > 162 timevar1->hours) ? 1 : 163 (timevar2->hours < 164 timevar1->hours) ? -1 : 165 (timevar2->minutes > 166 timevar1->minutes) ? 1 : 167 (timevar2->minutes < 168 timevar1->minutes) ? -1 : 169 (timevar2->seconds > 170 timevar1->seconds) ? 1 : 171 (timevar2->seconds < timevar1->seconds) ? -1 : 0; 172 } 173 return comp; 121 174 } 122 175 … … 125 178 /* return TRUE if file2 is newer than file1 */ 126 179 127 return (Test Dates(file1, file2) > 0);180 return (TestFDates(file1, file2, NULL, NULL, NULL, NULL) > 0); 128 181 } 129 182 … … 941 994 #pragma alloc_text(VALID,CheckDrive,IsRoot,IsFile,IsFullName,needsquoting) 942 995 #pragma alloc_text(VALID,IsValidDir,IsValidDrive,MakeValidDir,IsVowel) 943 #pragma alloc_text(VALID,IsFileSame,IsNewer,Test Dates,RootName,MakeFullName)996 #pragma alloc_text(VALID,IsFileSame,IsNewer,TestFDates,TestCDates,RootName,MakeFullName) 944 997 #pragma alloc_text(VALID,IsExecutable,IsBinary,IsDesktop,ParentIsDesktop) 945 998 #pragma alloc_text(FILLFLAGS,FillInDriveFlags,assign_ignores)
Note:
See TracChangeset
for help on using the changeset viewer.