common_trans: leave the shell handle commands containing = in arg0
This is probably an environment variable definition. * bin/common_trans.cc: Here. A use-case appears in the test of the next patch.
This commit is contained in:
parent
fbb9e4374e
commit
7b9cedc697
1 changed files with 9 additions and 1 deletions
|
|
@ -584,7 +584,8 @@ skip_ws(const char*& cmd)
|
||||||
// - can have >stderr and <stdin redirection
|
// - can have >stderr and <stdin redirection
|
||||||
// In particular, variable interpolation is not supported. Complex
|
// In particular, variable interpolation is not supported. Complex
|
||||||
// redirections (>& and such) are not support. Chains of commands
|
// redirections (>& and such) are not support. Chains of commands
|
||||||
// (pipes, semi-colons, etc.) are not supported.
|
// (pipes, semi-colons, etc.) are not supported. Envvar definitions
|
||||||
|
// before the command are not supported.
|
||||||
static void
|
static void
|
||||||
exec_command(const char* cmd)
|
exec_command(const char* cmd)
|
||||||
{
|
{
|
||||||
|
|
@ -635,6 +636,13 @@ exec_command(const char* cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If result is empty, we failed to found the command; let's see if
|
||||||
|
// the shell is smarter. If the command contains '=', it's unlikely
|
||||||
|
// to be a command, but probably an environment variable defintion
|
||||||
|
// as in
|
||||||
|
// FOO=1 command args..
|
||||||
|
if (result.empty() || strchr(result[0], '='))
|
||||||
|
goto use_shell;
|
||||||
{
|
{
|
||||||
if (stdin)
|
if (stdin)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue