Changeset 1768 for trunk/dll/arccnrs.c


Ignore:
Timestamp:
Mar 30, 2014, 7:37:05 PM (11 years ago)
Author:
Gregg Young
Message:

Last try to keep fix for Ticket 502. If it doesn't work need to revert FillArcCnr to 1747

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1757 r1768  
    581581//== FillArcCnr() generate archive content list and fill container window ==
    582582
    583 static INT FillArcCnr(HWND hwndCnr, CHAR * arcname, ARC_TYPE ** arcinfo, /*FOLD00*/
     583static INT FillArcCnr(HWND hwndCnr, CHAR * arcname, ARC_TYPE ** arcinfo,
    584584                      ULONGLONG * pullTotalBytes, volatile PCHAR pStopFlag)
    585585{
     
    589589  CHAR lonename[CCHMAXPATH + 2],
    590590       *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
    592592  CHAR s[CCHMAXPATH * 2];
     593  CHAR TestStr[CCHMAXPATH * 2];
    593594  BOOL gotstart;
    594595  BOOL gotend;
     
    596597  BOOL nomove = FALSE;                  // fixme to be gone?
    597598  BOOL notest;
    598   BOOL nobzip, ftarbz, nogzip, ftargz;
    599599  INT highest = 0, fieldnum, counter = 0, numarcfiles = 0;
    600600  PARCITEM lastpai;
     
    604604  APIRET rc;
    605605  CHAR *mode;
    606   ULONG cnter = 0;
     606  ULONG cnter = 0; 
    607607
    608608  if (!arcname || !arcinfo)
     
    620620           ArcTempRoot);
    621621  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
    666623
    667624ReTry:
     
    742699          }
    743700          else {
    744             rc = 0;
    745             //DbgMsg(pszSrcFile, __LINE__, "Number of tries %i", cnter);
    746             rc = SearchPathForFile(PCSZ_PATH, s, NULL);
    747             if (!rc) {
    748               cnter ++;
     701            rc = 0; 
     702            //DbgMsg(pszSrcFile, __LINE__, "Number of tries %i", cnter);
     703            rc = SearchPathForFile(PCSZ_PATH, s, NULL);
     704            if (!rc) {
     705              cnter ++;
    749706              runemf2(SEPARATE | INVISIBLE | MINIMIZED | BACKGROUND | WAIT,
    750707                      hwndCnr, pszSrcFile, __LINE__, NULL, NULL,
     
    752709                      info->list,
    753710                      BldQuotedFileName(s, arcname));
    754               if (cnter == 1) {
     711              if (cnter == 1) { 
    755712                if (info->test)
    756713                  strcpy(TestStr, info->test);
     
    764721                notest = FALSE;
    765722              }
    766             }
    767             oldstdout = fileno(stdout);
    768             DosError(FERR_DISABLEHARDERR);
    769             DosDupHandle(newstdout, &oldstdout);
    770             DosClose(newstdout);
    771             fclose(fp);
    772           }
     723            }
     724            oldstdout = fileno(stdout);
     725            DosError(FERR_DISABLEHARDERR);
     726            DosDupHandle(newstdout, &oldstdout);
     727            DosClose(newstdout);
     728            fclose(fp);
     729          }
    773730        }
    774731      }
     
    967924
    968925      fclose(fp);
    969       //DbgMsg(pszSrcFile, __LINE__, "Archive check counter %i numarcfiles %i gotstart %i %c",
    970       //       cnter, numarcfiles, gotstart, pStopFlag);
     926
    971927      if (*pStopFlag)
    972928        numarcfiles = 0;                // Request close
     
    978934        CHAR errstr[CCHMAXPATH + 256];
    979935
    980         // Try for alternate archiver
     936        // Try for alternate archiver
    981937        tinfo = info;
    982938        do {
     
    993949        if (!fAlertBeepOff)
    994950          DosBeep(750, 50);             // wake up user
    995         if (cnter > 0) {
     951
     952        if (cnter > 0) {
    996953          CHAR Temp[CCHMAXPATH + 2];
    997954
     
    1001958                  !numarcfiles ? GetPString(IDS_NOARCFILESFOUNDTEXT) : NullStr,
    1002959                  !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));
    1006961          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) { 
    1011966            strcpy(Temp, info->test);
    1012967            info->test = xstrdup(TestStr, pszSrcFile, __LINE__);
    1013968          }
    1014           else if ((ftarbz && !nobzip) || (ftargz && !nogzip))
    1015             info->test = xstrdup(ftarbz ? "bzip2.exe -t" : "gzip.exe - t",
    1016                                  pszSrcFile, __LINE__);
    1017969          else if (rc) {
    1018970            strcpy(Temp, info->test);
     
    1023975                    hwndCnr,
    1024976                    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)
    1030978            info->test = xstrdup(Temp, pszSrcFile, __LINE__);
    1031979        }
    1032         else
    1033           saymsg(MB_OK, HWND_DESKTOP, GetPString(IDS_ARCMISSINGEXE),
     980        else 
     981          saymsg(MB_OK, HWND_DESKTOP, GetPString(IDS_ARCMISSINGEXE),
    1034982                 GetPString(IDS_ARCMISSINGEXEVERBOSE));
    1035983      }
    1036984      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;
    1039987        info->next = arcsighead;
    1040988        arcsighead->prev = info;
     
    10571005
    10581006  return numarcfiles;
    1059 }
    1060 
     1007} // FillArcCnr
    10611008MRESULT EXPENTRY ArcTextProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) /*FOLD00*/
    10621009{
Note: See TracChangeset for help on using the changeset viewer.