summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-05-19 02:27:13 +0000
committermidipix <writeonce@midipix.org>2024-05-25 17:46:48 +0000
commit1aa8ec2ba690df836803e71d87dece253fd990bd (patch)
treef24c5511d2ed6c0f973063c70d1751a19de0190e /src
parent733811fb954b5dbb436dd2fe271249f62a77e67d (diff)
downloadtpax-1aa8ec2ba690df836803e71d87dece253fd990bd.tar.bz2
tpax-1aa8ec2ba690df836803e71d87dece253fd990bd.tar.xz
item queue: tpax_archive_append_item(): process directory-item child entries.
Diffstat (limited to 'src')
-rw-r--r--src/logic/tpax_archive_append.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/logic/tpax_archive_append.c b/src/logic/tpax_archive_append.c
index 026bc8d..362b85b 100644
--- a/src/logic/tpax_archive_append.c
+++ b/src/logic/tpax_archive_append.c
@@ -454,10 +454,14 @@ int tpax_archive_append_item(
const struct tpax_unit_ctx * uctx)
{
int fdat;
+ uintptr_t addr;
const char * name;
const char * mark;
const char * prefix;
bool fkeep;
+ struct tpax_dirent_buffer * dentbuf;
+ struct tpax_dirent * cdent;
+ struct tpax_dirent * cnext;
struct dirent * dirent;
char entbuf[PATH_MAX + sizeof(struct dirent)];
@@ -499,8 +503,28 @@ int tpax_archive_append_item(
TPAX_NESTED_ERROR(dctx),
0);
+ /* queue directory child items */
+ dentbuf = tpax_get_driver_dirents(dctx);
+ cdent = tpax_get_driver_dirmark(dctx);
+
+ for (; cdent; ) {
+ if (cdent->dirent.d_type == DT_DIR)
+ if (tpax_archive_append_dir_entries(dctx,cdent) < 0)
+ return TPAX_NESTED_ERROR(dctx);
+
+ addr = (uintptr_t)cdent;
+ addr += cdent->nsize;
+ cnext = (struct tpax_dirent *)addr;
+
+ if (cnext == dentbuf->cdent) {
+ dentbuf = dentbuf->next;
+ cnext = dentbuf ? dentbuf->dbuf : 0;
+ }
+
+ cdent = cnext;
+ }
+
(void)tpax_archive_append_pad;
- (void)tpax_archive_append_dir_entries;
return 0;
}