summaryrefslogtreecommitdiff
path: root/src/driver
diff options
context:
space:
mode:
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/slbt_driver_ctx.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 5013ad0..f44abfa 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -289,12 +289,19 @@ static int slbt_init_host_params(
{
size_t toollen;
char * dash;
+ char * base;
const char * machine;
bool ftarget = false;
bool fhost = false;
bool fcompiler = false;
bool fnative = false;
+ /* base */
+ if ((base = strrchr(cctx->cargv[0],'/')))
+ base++;
+ else
+ base = cctx->cargv[0];
+
/* host */
if (host->host) {
cfgmeta->host = cfgexplicit;
@@ -303,7 +310,7 @@ static int slbt_init_host_params(
host->host = cctx->target;
cfgmeta->host = cfgtarget;
ftarget = true;
- } else if (strrchr(cctx->cargv[0],'-')) {
+ } else if (strrchr(base,'-')) {
if (!(drvhost->host = strdup(cctx->cargv[0])))
return -1;