version 1.87, 2014/05/16 17:46:07 |
version 1.88, 2014/05/16 18:35:01 |
|
|
struct ohash_info info = { 0, NULL, ecalloc, efree, NULL }; |
struct ohash_info info = { 0, NULL, ecalloc, efree, NULL }; |
struct ohash myh; |
struct ohash myh; |
struct checksum c; |
struct checksum c; |
char *line, *endline; |
char *e, *line, *endline; |
const char *e; |
|
int hasfailed = 0; |
int hasfailed = 0; |
int i, rv; |
int i, rv; |
unsigned int slot; |
unsigned int slot; |
|
|
|
ohash_init(&myh, 6, &info); |
if (argc) { |
if (argc) { |
ohash_init(&myh, 6, &info); |
|
for (i = 0; i < argc; i++) { |
for (i = 0; i < argc; i++) { |
slot = ohash_qlookup(&myh, argv[i]); |
slot = ohash_qlookup(&myh, argv[i]); |
e = ohash_find(&myh, slot); |
e = ohash_find(&myh, slot); |
|
|
} |
} |
} else { |
} else { |
if (verifychecksum(&c, quiet) == 0) { |
if (verifychecksum(&c, quiet) == 0) { |
fprintf(stderr, "%s: FAIL\n", c.file); |
slot = ohash_qlookup(&myh, c.file); |
hasfailed = 1; |
e = ohash_find(&myh, slot); |
|
if (e == NULL) { |
|
if (!(e = strdup(c.file))) |
|
err(1, "strdup"); |
|
ohash_insert(&myh, slot, e); |
|
} |
} |
} |
} |
} |
} |
} |
|
|
if (argc) { |
for (e = ohash_first(&myh, &slot); e != NULL; e = ohash_next(&myh, &slot)) { |
for (i = 0; i < argc; i++) { |
fprintf(stderr, "%s: FAIL\n", e); |
slot = ohash_qlookup(&myh, argv[i]); |
hasfailed = 1; |
e = ohash_find(&myh, slot); |
if (argc == 0) |
if (e != NULL) { |
free(e); |
fprintf(stderr, "%s: FAIL\n", argv[i]); |
|
hasfailed = 1; |
|
} |
|
} |
|
ohash_delete(&myh); |
|
} |
} |
|
ohash_delete(&myh); |
if (hasfailed) |
if (hasfailed) |
exit(1); |
exit(1); |
} |
} |