diff options
Diffstat (limited to 'src/logic/slbt_exec_execute.c')
-rw-r--r-- | src/logic/slbt_exec_execute.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/logic/slbt_exec_execute.c b/src/logic/slbt_exec_execute.c index b397306..9966e4d 100644 --- a/src/logic/slbt_exec_execute.c +++ b/src/logic/slbt_exec_execute.c @@ -49,16 +49,6 @@ int slbt_exec_execute( script = ectx->cargv[1]; if (script) { - /* wrapper */ - if ((size_t)snprintf(wrapper,sizeof(wrapper), - "%s%s.exe.wrapper", - (script[0] == '/') ? "" : "./", - script) - >= sizeof(wrapper)) { - slbt_free_exec_ctx(actx); - return SLBT_BUFFER_ERROR(dctx); - } - /* exeref */ if ((base = strrchr(script,'/'))) base++; @@ -69,6 +59,15 @@ int slbt_exec_execute( mark = exeref + (base - script); sprintf(mark,".libs/%s",base); + /* wrapper */ + if ((size_t)snprintf(wrapper,sizeof(wrapper), + "%s.exe.wrapper", + exeref) + >= sizeof(wrapper)) { + slbt_free_exec_ctx(actx); + return SLBT_BUFFER_ERROR(dctx); + } + /* fdcwd */ fdcwd = slbt_driver_fdcwd(dctx); |