Changeset 1768 for trunk/dll/arccnrs.c
- Timestamp:
- Mar 30, 2014, 7:37:05 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/arccnrs.c
r1757 r1768 581 581 //== FillArcCnr() generate archive content list and fill container window == 582 582 583 static INT FillArcCnr(HWND hwndCnr, CHAR * arcname, ARC_TYPE ** arcinfo, /*FOLD00*/583 static INT FillArcCnr(HWND hwndCnr, CHAR * arcname, ARC_TYPE ** arcinfo, 584 584 ULONGLONG * pullTotalBytes, volatile PCHAR pStopFlag) 585 585 { … … 589 589 CHAR lonename[CCHMAXPATH + 2], 590 590 *nsize, *osize, *fdate, *fname, *p, *pp, *arctemp; 591 CHAR TestStr[CCHMAXPATH * 2];591 // Change the DosQueryAppType call below to xDosQueryAppType if "s" is no longer in low memory 592 592 CHAR s[CCHMAXPATH * 2]; 593 CHAR TestStr[CCHMAXPATH * 2]; 593 594 BOOL gotstart; 594 595 BOOL gotend; … … 596 597 BOOL nomove = FALSE; // fixme to be gone? 597 598 BOOL notest; 598 BOOL nobzip, ftarbz, nogzip, ftargz;599 599 INT highest = 0, fieldnum, counter = 0, numarcfiles = 0; 600 600 PARCITEM lastpai; … … 604 604 APIRET rc; 605 605 CHAR *mode; 606 ULONG cnter = 0; 606 ULONG cnter = 0; 607 607 608 608 if (!arcname || !arcinfo) … … 620 620 ArcTempRoot); 621 621 MakeTempName(arctemp, ArcTempRoot, 2); 622 p = strrchr(arcname, '.'); 623 if (p) { 624 APIRET temp; 625 626 p = p - 3; 627 nobzip = stricmp(p, "TAR.BZ"); 628 nogzip = stricmp(p, "TAR.GZ"); 629 if (!nobzip) { 630 ftarbz = TRUE; 631 if (DosQueryAppType("bzip2.exe" , &apptype)) { 632 nobzip = TRUE; 633 if (!fDontAskBzip) { 634 temp = saymsg2(NULL, 3, 635 HWND_DESKTOP, 636 NullStr, 637 GetPString(IDS_ARCNOBZIP)); 638 if (temp == SM2_NO ||temp == SM2_CANCEL) 639 return 0; 640 else if (temp == SM2_DONTASK) { 641 fDontAskBzip = TRUE; 642 PrfWriteProfileData(fmprof, FM3Str, "DontAskBzip", &fDontAskBzip, sizeof(BOOL)); 643 } 644 } 645 } 646 } 647 else if (!nogzip) { 648 ftargz = TRUE; 649 if (DosQueryAppType("gzip.exe" , &apptype)) { 650 nogzip = TRUE; 651 if (!fDontAskGzip) { 652 temp = saymsg2(NULL, 3, 653 HWND_DESKTOP, 654 NullStr, 655 GetPString(IDS_ARCNOGZIP)); 656 if (temp == SM2_NO || temp == SM2_CANCEL) 657 return 0; 658 else if (temp == SM2_DONTASK) { 659 fDontAskGzip = TRUE; 660 PrfWriteProfileData(fmprof, FM3Str, "DontAskGzip", &fDontAskGzip, sizeof(BOOL)); 661 } 662 } 663 } 664 } 665 } 622 666 623 667 624 ReTry: … … 742 699 } 743 700 else { 744 rc = 0; 745 746 747 748 701 rc = 0; 702 //DbgMsg(pszSrcFile, __LINE__, "Number of tries %i", cnter); 703 rc = SearchPathForFile(PCSZ_PATH, s, NULL); 704 if (!rc) { 705 cnter ++; 749 706 runemf2(SEPARATE | INVISIBLE | MINIMIZED | BACKGROUND | WAIT, 750 707 hwndCnr, pszSrcFile, __LINE__, NULL, NULL, … … 752 709 info->list, 753 710 BldQuotedFileName(s, arcname)); 754 if (cnter == 1) { 711 if (cnter == 1) { 755 712 if (info->test) 756 713 strcpy(TestStr, info->test); … … 764 721 notest = FALSE; 765 722 } 766 767 768 769 770 771 772 723 } 724 oldstdout = fileno(stdout); 725 DosError(FERR_DISABLEHARDERR); 726 DosDupHandle(newstdout, &oldstdout); 727 DosClose(newstdout); 728 fclose(fp); 729 } 773 730 } 774 731 } … … 967 924 968 925 fclose(fp); 969 //DbgMsg(pszSrcFile, __LINE__, "Archive check counter %i numarcfiles %i gotstart %i %c", 970 // cnter, numarcfiles, gotstart, pStopFlag); 926 971 927 if (*pStopFlag) 972 928 numarcfiles = 0; // Request close … … 978 934 CHAR errstr[CCHMAXPATH + 256]; 979 935 980 936 // Try for alternate archiver 981 937 tinfo = info; 982 938 do { … … 993 949 if (!fAlertBeepOff) 994 950 DosBeep(750, 50); // wake up user 995 if (cnter > 0) { 951 952 if (cnter > 0) { 996 953 CHAR Temp[CCHMAXPATH + 2]; 997 954 … … 1001 958 !numarcfiles ? GetPString(IDS_NOARCFILESFOUNDTEXT) : NullStr, 1002 959 !gotend ? GetPString(IDS_NOENDOFLISTTEXT) : NullStr, 1003 !notest ? NullStr : GetPString(IDS_ARCNOTEST), 1004 ftarbz && !nobzip ? GetPString(IDS_ARCBZIPTESTTARBZ) : NullStr, 1005 ftargz && !nogzip ? GetPString(IDS_ARCGZIPTESTTARGZ) : NullStr); 960 !notest ? NullStr : GetPString(IDS_ARCNOTEST)); 1006 961 memset(&ad, 0, sizeof(ARCDUMP)); 1007 ad.info = info; 1008 strcpy(ad.listname, arctemp); 1009 strcpy(ad.arcname, arcname); 1010 if (!notest) { 962 ad.info = info; 963 strcpy(ad.listname, arctemp); 964 strcpy(ad.arcname, arcname); 965 if (!notest) { 1011 966 strcpy(Temp, info->test); 1012 967 info->test = xstrdup(TestStr, pszSrcFile, __LINE__); 1013 968 } 1014 else if ((ftarbz && !nobzip) || (ftargz && !nogzip))1015 info->test = xstrdup(ftarbz ? "bzip2.exe -t" : "gzip.exe - t",1016 pszSrcFile, __LINE__);1017 969 else if (rc) { 1018 970 strcpy(Temp, info->test); … … 1023 975 hwndCnr, 1024 976 ArcErrProc, FM3ModHandle, ARCERR_FRAME, MPFROMP(&ad)); 1025 if (!notest) 1026 info->test = xstrdup(Temp, pszSrcFile, __LINE__); 1027 else if ((ftarbz && !nobzip) || (ftargz && !nogzip)) 1028 info->test = xstrdup("", pszSrcFile, __LINE__); 1029 else if (rc) 977 if (!notest || rc) 1030 978 info->test = xstrdup(Temp, pszSrcFile, __LINE__); 1031 979 } 1032 else 1033 980 else 981 saymsg(MB_OK, HWND_DESKTOP, GetPString(IDS_ARCMISSINGEXE), 1034 982 GetPString(IDS_ARCMISSINGEXEVERBOSE)); 1035 983 } 1036 984 else if (!nomove && tinfo) { 1037 // if we got a false hit, move working hit to top 1038 tinfo = info->next; 985 // if we got a false hit, move working hit to top 986 tinfo = info->next; 1039 987 info->next = arcsighead; 1040 988 arcsighead->prev = info; … … 1057 1005 1058 1006 return numarcfiles; 1059 } 1060 1007 } // FillArcCnr 1061 1008 MRESULT EXPENTRY ArcTextProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) /*FOLD00*/ 1062 1009 {
Note:
See TracChangeset
for help on using the changeset viewer.