diff options
-rw-r--r-- | include/slibtool/slibtool.h | 1 | ||||
-rw-r--r-- | src/logic/slbt_exec_ctx.c | 3 |
2 files changed, 3 insertions, 1 deletions
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]; /* <compiler> */ ictx->ctx.program = dctx->cctx->cargv[0]; |