From f4776113b75bf3839b7f5a4c51b736eb3e208236 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 4 Apr 2016 21:27:57 -0400 Subject: execution context: added exefilename initialization. --- src/logic/slbt_exec_ctx.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/logic/slbt_exec_ctx.c') diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c index 706fd51..df7f693 100644 --- a/src/logic/slbt_exec_ctx.c +++ b/src/logic/slbt_exec_ctx.c @@ -140,6 +140,7 @@ int slbt_get_exec_ctx( char ** parg; char * ch; char * mark; + char * slash; const char * ref; int i; @@ -288,6 +289,20 @@ int slbt_get_exec_ctx( + sizeof('\0'); } + /* linking: exefilename */ + if (dctx->cctx->mode == SLBT_MODE_LINK && !dctx->cctx->libname) { + ictx->ctx.exefilename = ch; + + if ((slash = strrchr(dctx->cctx->output,'/'))) { + strcpy(ch,dctx->cctx->output); + mark = ch + (slash - dctx->cctx->output); + sprintf(++mark,".libs/%s",++slash); + ch += strlen(ch) + sizeof('\0'); + } else + ch += sprintf(ch,".libs/%s",dctx->cctx->output) + + sizeof('\0'); + } + /* argument strings shadow copy */ memcpy(ictx->shadow,ictx->args,ictx->size); -- cgit v1.2.3