From a21ac16a21223b03b38808d0d43d9cf204f4deb7 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 22 Apr 2016 11:50:07 -0400 Subject: driver: slbt_init_host_params(): fix host heuristics. --- src/driver/slbt_driver_ctx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3