Changeset 1298 for trunk/dll/arccnrs.c


Ignore:
Timestamp:
Nov 23, 2008, 9:48:15 PM (17 years ago)
Author:
John Small
Message:

ARCCNRS.C: Support archivers with no Start or End of list strings (Ticket 284)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1272 r1298  
    6161  08 Nov 08 GKY Add WaitChildThread to fix hang caused by viewer trying to open a file before
    6262                the archiver process closes. (Ticket 58)
     63  23 Nov 08 JBS Ticket 284: Support archivers with no Start or End of list strings
    6364
    6465***********************************************************************/
     
    552553  BOOL wasquote;
    553554  BOOL nomove = FALSE;                  // fixme to be gone?
    554   INT highest = 0, x, counter = 0, numarcfiles = 0;
     555  INT highest = 0, fieldnum, counter = 0, numarcfiles = 0;
    555556  PARCITEM lastpai;
    556557  ARC_TYPE *info;
     
    670671
    671672    if (fp) {
    672       gotstart = !info->startlist || !*info->startlist; // If list has no start marker
     673      gotstart = !info->startlist ||            // If list has no start marker
     674                 !*info->startlist ||
     675                 (stricmp(info->startlist, "*#* None *#*") == 0);
     676//       gotend =   !info->endlist ||
     677//                       !*info->endlist ||     // If list has no end marker
     678//                       (stricmp(info->endlist, "*#* None *#*") == 0);
    673679
    674680      while (!feof(fp) && !gotend && !*pStopFlag) {
     
    701707          osize = fdate = NullStr;
    702708          p = s;
    703           for (x = 0; x <= highest; x++) {
     709          for (fieldnum = 0; fieldnum <= highest; fieldnum++) {
    704710            pp = p;
    705711            while (*pp && (*pp == ' ' || *pp == '\t'))  /* skip leading */
     
    710716            p = pp;
    711717            while (*p && (wasquote ||
    712                           ((x != info->fnpos || !info->nameislast) ?
     718                          ((fieldnum != info->fnpos || !info->nameislast) ?
    713719                           (*p != ' ' && *p != '\t') : TRUE))) {
    714720              if (*p == '\"') {
     
    731737              p++;
    732738            }
    733             if (x == info->nsizepos)
     739            if (fieldnum == info->nsizepos)
    734740              nsize = pp;
    735             else if (x == info->osizepos)
     741            else if (fieldnum == info->osizepos)
    736742              osize = pp;
    737             else if (x == info->fdpos) {
     743            else if (fieldnum == info->fdpos) {
    738744              fdate = pp;
    739745              if (info->fdflds > 1 && info->fdflds < 24) {
     
    748754                    while (*p && (*p != ' ' && *p != '\t'))
    749755                      p++;
    750                     x++;
     756                    fieldnum++;
    751757                  }
    752758                  if (*p) {
     
    757763              }
    758764            }
    759             else if (x == info->fnpos) {
     765            else if (fieldnum == info->fnpos) {
    760766              fname = pp;
    761767              if (pp && *pp == '*' && !*(pp + 1))       /* workaround for LH.EXE */
     
    849855        numarcfiles = 0;                // Request close
    850856      else if (!numarcfiles || !gotstart
    851                || (!gotend && info->endlist && *info->endlist)) {
     857               || (!gotend && info->endlist && *info->endlist && (stricmp(info->endlist, "*#* None *#*")))) {
    852858        // Oops
    853859        ARCDUMP ad;
Note: See TracChangeset for help on using the changeset viewer.