Changeset 279


Ignore:
Timestamp:
Dec 8, 2005, 8:43:33 AM (20 years ago)
Author:
root
Message:

Comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/avl.c

    r251 r279  
    1313  13 Aug 05 SHL find_type: correct no sig exists bypass logic
    1414  13 Aug 05 SHL SBoxDlgProc: avoid dereferencing NULL signature
     15  18 Aug 05 SHL Comments
    1516
    1617***********************************************************************/
     
    131132    } // for
    132133    DosClose(handle);                   /* Either way, we're done for now */
    133     return info;                        /* return signature, if any */
     134    return info;                        /* Return signature, if any */
    134135}
    135136
     
    139140{
    140141    FILE *handle;
    141     CHAR s[257], *p;
    142     ARC_TYPE *info = NULL, *last = NULL;
    143     INT numlines = NUMLINES, x;
     142    CHAR s[257];
     143    CHAR *p;
     144    ARC_TYPE *info = NULL;
     145    ARC_TYPE *last = NULL;
     146    INT numlines = NUMLINES;
     147    INT x;
    144148
    145149    loadedarcs = TRUE;
     
    156160        return -2;
    157161    strcpy(archiverbb2, p);
     162    // Get lines per record count
    158163    if (!fgets(s, 256, handle))
    159164    {
     
    163168    p = strchr(s, ';');
    164169    if (p)
    165         *p = 0;
     170        *p = 0;                         // Chop trailing comment
    166171    bstripcr(s);
    167172    if (*s)
     
    169174    if (!*s || numlines < NUMLINES)
    170175        return -3;
     176    // Parse rest
    171177    while (!feof(handle))
    172178    {
    173179        if (!fgets(s, 256, handle))
    174             break;
     180            break;                      // EOF
    175181        p = strchr(s, ';');
    176182        if (p)
    177183            *p = 0;                     // Chop comment
    178 
    179184        bstripcr(s);
     185        // 1st non-blank line starts definition
     186        // fixme to preserve comments
     187        // fixme to avoid allocating empty fields
    180188        if (*s)
    181189        {
    182190            info = malloc(sizeof(ARC_TYPE));
    183191            if (!info)
    184                 break;
     192                break;                  // fixme to complain
    185193            memset(info, 0, sizeof(ARC_TYPE));
    186194            if (*s)
     
    381389                }
    382390            }
     391            // Ignore unknown lines - must be newer file format
    383392            for (x = NUMLINES; x < numlines; x++)
    384393            {
     
    386395                    break;
    387396            }
     397
    388398            info -> next = NULL;
     399
    389400            if (!arcsighead)
    390401            {
     
    398409                last = info;
    399410            }
    400             if (info -> extract &&
    401                     !*info -> extract)
     411            if (info -> extract && !*info -> extract)
    402412            {
    403413                free(info -> extract);
    404414                info -> extract = NULL;
    405415            }
    406         }
     416        } // if got definition
    407417        info = NULL;
    408418    }
     
    410420    if (info)
    411421    {
     422        // fixme to complain about partial definition
    412423        if (info -> id)
    413424            free(info -> id);
     
    491502                        if (test -> signature && temp -> signature &&
    492503                            !strcmp(test -> signature, temp -> signature))
    493                             goto ContinueHere;          // Got match
     504                            goto ContinueHere;  // Got match
    494505                        test = test -> next;
    495506                    }
Note: See TracChangeset for help on using the changeset viewer.