diff options
Diffstat (limited to 'src/logic')
-rw-r--r-- | src/logic/slbt_exec_link.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c index 3836f14..ea5dccf 100644 --- a/src/logic/slbt_exec_link.c +++ b/src/logic/slbt_exec_link.c @@ -583,15 +583,23 @@ static int slbt_exec_link_adjust_argument_vector( return ret; } - *aarg++ = *carg++; - *aarg++ = ++mark; + dlen = strlen(dctx->cctx->settings.dsoprefix); + + /* -module? (todo: non-portable usage, display warning) */ + if (strncmp(++slash,dctx->cctx->settings.dsoprefix,dlen)) { + *--slash = '/'; + strcpy(*carg,arg); + *aarg++ = *carg++; + } else { + *aarg++ = *carg++; + *aarg++ = ++mark; - ++slash; - slash += strlen(dctx->cctx->settings.dsoprefix); + slash += dlen; - sprintf(mark,"-l%s",slash); - dot = strrchr(mark,'.'); - *dot = 0; + sprintf(mark,"-l%s",slash); + dot = strrchr(mark,'.'); + *dot = 0; + } } else { *aarg++ = *carg++; } |