Test/fix symlink test/extract in v1 file format
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 11s

This commit is contained in:
Stephen Seo 2024-09-30 17:53:39 +09:00
parent 0ae80168e3
commit f89e5f7640
2 changed files with 19 additions and 5 deletions

Binary file not shown.

View file

@ -2285,11 +2285,17 @@ int simple_archiver_parse_archive_version_1(FILE *in_f, int_fast8_t do_extract,
read_buf_full_from_fd(in_f, (char *)buf, 1024, u16 + 1, link_name);
if (ret != SDAS_SUCCESS) {
return ret;
} else if (working_files_map &&
simple_archiver_hash_map_get(working_files_map, link_name,
u16 + 1) == NULL) {
}
if (!do_extract) {
fprintf(stderr, " Link name: %s\n", link_name);
}
if (working_files_map &&
simple_archiver_hash_map_get(working_files_map, link_name, u16 + 1) ==
NULL) {
skip_due_to_map = 1;
fprintf(stderr, "Skipping not specified in args...\n");
fprintf(stderr, " Skipping not specified in args...\n");
}
if (fread(buf, 1, 2, in_f) != 2) {
@ -2318,7 +2324,11 @@ int simple_archiver_parse_archive_version_1(FILE *in_f, int_fast8_t do_extract,
link_extracted = 1;
fprintf(stderr, " %s -> %s\n", link_name, path);
#endif
} else {
fprintf(stderr, " Abs path: %s\n", path);
}
} else if (!do_extract) {
fprintf(stderr, " No Absolute path.\n");
}
if (fread(buf, 1, 2, in_f) != 2) {
@ -2347,10 +2357,14 @@ int simple_archiver_parse_archive_version_1(FILE *in_f, int_fast8_t do_extract,
link_extracted = 1;
fprintf(stderr, " %s -> %s\n", link_name, path);
#endif
} else {
fprintf(stderr, " Rel path: %s\n", path);
}
} else if (!do_extract) {
fprintf(stderr, " No Relative path.\n");
}
if (!link_extracted && !skip_due_to_map) {
if (do_extract && !link_extracted && !skip_due_to_map) {
fprintf(stderr, "WARNING Symlink \"%s\" was not created!\n", link_name);
}
}