diff options
author | midipix <writeonce@midipix.org> | 2024-01-06 09:19:04 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-01-22 03:49:50 +0000 |
commit | 7bab5a71cefe37b583b08fec0177fc569f041980 (patch) | |
tree | 2b9df70fa95b7481deff97d66fbc3b00a46681ff /src/logic | |
parent | d4473b3be02d429a72347914a6fc7e5688ad98e5 (diff) | |
download | slibtool-7bab5a71cefe37b583b08fec0177fc569f041980.tar.bz2 slibtool-7bab5a71cefe37b583b08fec0177fc569f041980.tar.xz |
ar mode: slbt_get_archive_ctx(): initial implementation and integration.
Diffstat (limited to 'src/logic')
-rw-r--r-- | src/logic/slbt_exec_ar.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/logic/slbt_exec_ar.c b/src/logic/slbt_exec_ar.c index a68ff03..56eee4e 100644 --- a/src/logic/slbt_exec_ar.c +++ b/src/logic/slbt_exec_ar.c @@ -71,6 +71,7 @@ int slbt_exec_ar( char ** argv; char ** iargv; struct slbt_archive_ctx ** arctxv; + struct slbt_archive_ctx ** arctxp; const char ** unitv; const char ** unitp; size_t nunits; @@ -160,7 +161,25 @@ int slbt_exec_ar( if (!entry->fopt) *unitp++ = entry->arg; + /* archive context vector initialization */ + for (unitp=unitv,arctxp=arctxv; *unitp; unitp++,arctxp++) { + if (slbt_get_archive_ctx(dctx,*unitp,arctxp) < 0) { + for (arctxp=arctxv; *arctxp; arctxp++) + slbt_free_archive_ctx(*arctxp); + + free(unitv); + free(arctxv); + + return slbt_exec_ar_fail( + actx,meta, + SLBT_NESTED_ERROR(dctx)); + } + } + /* all done */ + for (arctxp=arctxv; *arctxp; arctxp++) + slbt_free_archive_ctx(*arctxp); + free(unitv); free(arctxv); |