summaryrefslogtreecommitdiffhomepage
path: root/src/logic/slbt_exec_ar.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-17 00:44:29 +0000
committermidipix <writeonce@midipix.org>2024-02-17 00:44:29 +0000
commit7ffcb591bd686006e325722b45c1fe91d1ff3eff (patch)
tree63b8da166c53a4689adef4fe02d290093760e041 /src/logic/slbt_exec_ar.c
parent0b177bee8b822e7291764b8c7c097125218da782 (diff)
downloadslibtool-7ffcb591bd686006e325722b45c1fe91d1ff3eff.tar.bz2
slibtool-7ffcb591bd686006e325722b45c1fe91d1ff3eff.tar.xz
ar mode: posix pretty printer: multiple inputs: also print the archive name.
Diffstat (limited to 'src/logic/slbt_exec_ar.c')
-rw-r--r--src/logic/slbt_exec_ar.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/logic/slbt_exec_ar.c b/src/logic/slbt_exec_ar.c
index eab86ea..9b400af 100644
--- a/src/logic/slbt_exec_ar.c
+++ b/src/logic/slbt_exec_ar.c
@@ -79,10 +79,21 @@ static int slbt_exec_ar_perform_archive_actions(
{
struct slbt_archive_ctx ** arctxp;
struct slbt_archive_ctx * arctx;
+ bool farname;
+
+ switch (dctx->cctx->fmtflags & SLBT_PRETTY_FLAGS) {
+ case SLBT_PRETTY_POSIX:
+ farname = (arctxv[0] && arctxv[1]);
+ break;
+
+ default:
+ farname = true;
+ break;
+ }
for (arctxp=arctxv; *arctxp; arctxp++) {
if (dctx->cctx->fmtflags & SLBT_DRIVER_MODE_AR_OUTPUTS)
- if (slbt_ar_output_arname(*arctxp) < 0)
+ if (farname && (slbt_ar_output_arname(*arctxp) < 0))
return SLBT_NESTED_ERROR(dctx);
if (dctx->cctx->fmtflags & SLBT_OUTPUT_ARCHIVE_MEMBERS)