summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/slibtool/slibtool.h1
-rw-r--r--src/logic/slbt_exec_ctx.c17
2 files changed, 13 insertions, 5 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h
index b9327f4..88bb26e 100644
--- a/include/slibtool/slibtool.h
+++ b/include/slibtool/slibtool.h
@@ -90,6 +90,7 @@ struct slbt_exec_ctx {
char * ldirname;
char * lbasename;
char * lobjname;
+ char * aobjname;
pid_t pid;
int exitcode;
};
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index cfa7434..f6bea2e 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -77,11 +77,11 @@ static struct slbt_exec_ctx_impl * slbt_exec_ctx_alloc(
else
size += sizeof('\0') + strlen(*parg);
- /* buffer size (ldirname, lbasename, lobjname) */
+ /* buffer size (ldirname, lbasename, lobjname, aobjname) */
if (dctx->cctx->output)
- size += 3*strlen(dctx->cctx->output);
+ size += 4*strlen(dctx->cctx->output);
else if ((csrc = slbt_source_file(dctx->cctx->cargv)))
- size += 3*strlen(csrc);
+ size += 4*strlen(csrc);
/* alloc */
if (!(args = malloc(size)))
@@ -197,9 +197,16 @@ int slbt_get_exec_ctx(
*ictx->ctx.lout[1] = ch;
ictx->ctx.lobjname = ch;
- sprintf(ch,"%s%s",
+ ch += sprintf(ch,"%s%s",
ictx->ctx.ldirname,
- ictx->ctx.lbasename);
+ ictx->ctx.lbasename)
+ + sizeof('\0');
+
+ ictx->ctx.aobjname = ch;
+
+ ch += sprintf(ch,"%s",ictx->ctx.ldirname);
+ ch -= strlen(".libs/");
+ sprintf(ch,ictx->ctx.lbasename);
}
*ectx = &ictx->ctx;