From 6689068df459076614129bdb9505ccbcef07e34c Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 28 Apr 2016 15:09:07 -0400 Subject: install mode: work around non-conforming uses of --mode=install. --- src/logic/slbt_exec_install.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/logic/slbt_exec_install.c') diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c index c4fd40d..66cf7f0 100644 --- a/src/logic/slbt_exec_install.c +++ b/src/logic/slbt_exec_install.c @@ -442,6 +442,7 @@ int slbt_exec_install( { int ret; char ** argv; + char ** iargv; char ** src; char ** dst; struct slbt_exec_ctx * actx; @@ -464,15 +465,19 @@ int slbt_exec_install( /* initial state, install mode skin */ slbt_reset_arguments(ectx); slbt_disable_placeholders(ectx); - argv = ectx->cargv; + iargv = ectx->cargv; + + /* work around non-conforming uses of --mode=install */ + if (!(strcmp(iargv[0],"/bin/sh")) || !strcmp(iargv[0],"/bin/bash")) + iargv++; /* missing arguments? */ - if (!argv[1] && (dctx->cctx->drvflags & SLBT_DRIVER_VERBOSITY_USAGE)) + if (!iargv[1] && (dctx->cctx->drvflags & SLBT_DRIVER_VERBOSITY_USAGE)) return slbt_install_usage(dctx->program,0,options,0); /* argv meta */ if (!(meta = argv_get( - argv, + iargv, options, dctx->cctx->drvflags & SLBT_DRIVER_VERBOSITY_ERRORS ? ARGV_VERBOSITY_ERRORS @@ -485,7 +490,7 @@ int slbt_exec_install( dest = 0; last = 0; - *argv++ = ectx->cargv[0]; + *argv++ = iargv[0]; for (entry=meta->entries; entry->fopt || entry->arg; entry++) { if (entry->fopt) { -- cgit v1.2.3