Changeset 279
- Timestamp:
- Dec 8, 2005, 8:43:33 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/avl.c
r251 r279 13 13 13 Aug 05 SHL find_type: correct no sig exists bypass logic 14 14 13 Aug 05 SHL SBoxDlgProc: avoid dereferencing NULL signature 15 18 Aug 05 SHL Comments 15 16 16 17 ***********************************************************************/ … … 131 132 } // for 132 133 DosClose(handle); /* Either way, we're done for now */ 133 return info; /* return signature, if any */134 return info; /* Return signature, if any */ 134 135 } 135 136 … … 139 140 { 140 141 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; 144 148 145 149 loadedarcs = TRUE; … … 156 160 return -2; 157 161 strcpy(archiverbb2, p); 162 // Get lines per record count 158 163 if (!fgets(s, 256, handle)) 159 164 { … … 163 168 p = strchr(s, ';'); 164 169 if (p) 165 *p = 0; 170 *p = 0; // Chop trailing comment 166 171 bstripcr(s); 167 172 if (*s) … … 169 174 if (!*s || numlines < NUMLINES) 170 175 return -3; 176 // Parse rest 171 177 while (!feof(handle)) 172 178 { 173 179 if (!fgets(s, 256, handle)) 174 break; 180 break; // EOF 175 181 p = strchr(s, ';'); 176 182 if (p) 177 183 *p = 0; // Chop comment 178 179 184 bstripcr(s); 185 // 1st non-blank line starts definition 186 // fixme to preserve comments 187 // fixme to avoid allocating empty fields 180 188 if (*s) 181 189 { 182 190 info = malloc(sizeof(ARC_TYPE)); 183 191 if (!info) 184 break; 192 break; // fixme to complain 185 193 memset(info, 0, sizeof(ARC_TYPE)); 186 194 if (*s) … … 381 389 } 382 390 } 391 // Ignore unknown lines - must be newer file format 383 392 for (x = NUMLINES; x < numlines; x++) 384 393 { … … 386 395 break; 387 396 } 397 388 398 info -> next = NULL; 399 389 400 if (!arcsighead) 390 401 { … … 398 409 last = info; 399 410 } 400 if (info -> extract && 401 !*info -> extract) 411 if (info -> extract && !*info -> extract) 402 412 { 403 413 free(info -> extract); 404 414 info -> extract = NULL; 405 415 } 406 } 416 } // if got definition 407 417 info = NULL; 408 418 } … … 410 420 if (info) 411 421 { 422 // fixme to complain about partial definition 412 423 if (info -> id) 413 424 free(info -> id); … … 491 502 if (test -> signature && temp -> signature && 492 503 !strcmp(test -> signature, temp -> signature)) 493 goto ContinueHere; 504 goto ContinueHere; // Got match 494 505 test = test -> next; 495 506 }
Note:
See TracChangeset
for help on using the changeset viewer.