From 6d0e8adf800c3f3bd5767ebb0cd6d2842d56a337 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 20 Mar 2016 11:44:43 -0400 Subject: struct slbt_exec_ctx: added alternate argument vector for ar invocation. --- include/slibtool/slibtool.h | 1 + src/logic/slbt_exec_ctx.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h index 5f0a76a..c1aea06 100644 --- a/include/slibtool/slibtool.h +++ b/include/slibtool/slibtool.h @@ -85,6 +85,7 @@ struct slbt_exec_ctx { char * program; char ** argv; char ** envp; + char ** altv; char ** dpic; char ** fpic; char ** cass; diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c index 5dd9d70..0af29ca 100644 --- a/src/logic/slbt_exec_ctx.c +++ b/src/logic/slbt_exec_ctx.c @@ -102,7 +102,7 @@ static struct slbt_exec_ctx_impl * slbt_exec_ctx_alloc( if (!(args = malloc(size))) return 0; - size = sizeof(*ictx) + (argc+SLBT_ARGV_SPARE_PTRS)*sizeof(char *); + size = sizeof(*ictx) + (2*(argc+1)+SLBT_ARGV_SPARE_PTRS)*sizeof(char *); if (!(ictx = calloc(1,size))) { free(args); @@ -136,6 +136,7 @@ int slbt_get_exec_ctx( /* init with guard for later .lo check */ ch = ictx->args + strlen(".lo"); ictx->ctx.argv = ictx->buffer; + ictx->ctx.altv = &ictx->buffer[ictx->argc + 1]; /* */ ictx->ctx.program = dctx->cctx->cargv[0]; -- cgit v1.2.3