Changeset 248 for trunk/dll/avl.c


Ignore:
Timestamp:
Aug 14, 2005, 1:32:09 AM (20 years ago)
Author:
root
Message:

find_type: correct no sig exists bypass logic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/avl.c

    r247 r248  
    1111  01 Aug 04 SHL Rework lstrip/rstrip usage
    1212  13 Aug 05 SHL Beautify with indent
     13  13 Aug 05 SHL find_type: correct no sig exists bypass logic
    1314
    1415***********************************************************************/
     
    6162{
    6263    HFILE handle;
    63     ULONG action, len, l;
     64    ULONG action;
     65    ULONG len;
     66    ULONG l;
    6467    ARC_TYPE *info;
    65     CHAR *p, buffer[80];        /* Read buffer for the signatures. */
     68    CHAR *p;
     69    CHAR buffer[80];
    6670
    6771    if (!loadedarcs)
    6872        load_archivers();
    69     if (topsig == NULL)
     73    if (!topsig)
    7074        topsig = arcsighead;
    7175    DosError(FERR_DISABLEHARDERR);
     
    8488                0L))
    8589        return NULL;
    86     info = topsig;                      /* start of signatures */
    87     while (info)
     90    // Scan signatures
     91    for (info = topsig; info; info = info -> next)
    8892    {
    89         if (!info -> signature ||
    90                 !*info -> signature)
    91         {                               /* no signature -- work on extension only */
     93        if (!info -> signature || !*info -> signature)
     94        {
     95            // No signature -- check extension
    9296            p = strrchr(filespec, '.');
    9397            if (p)
     
    97101                        *(info -> ext) &&
    98102                        !stricmp(p, info -> ext))
    99                     break;
    100             }
     103                    break;              // Matched
     104            }
     105            continue;                   // Next sig
    101106        }
    102         l = strlen(info -> signature);  /* Get the signature length. */
     107        // Try signature match
     108        l = strlen(info -> signature);
    103109        l = min(l, 79);
    104110        if (!DosChgFilePtr(handle,
     
    118124                            buffer,
    119125                            l))
    120                     break;
     126                    break;              // Matched
    121127            }
    122128        }
    123         info = info -> next;
    124     }
     129    } // for
    125130    DosClose(handle);                   /* Either way, we're done for now */
    126131    return info;                        /* return signature, if any */
Note: See TracChangeset for help on using the changeset viewer.