Fix conversion from C++ std::string into C const char *.

This fixes operation on MIPS64EB with GCC 4.2.1.

Reviewed by:	jmmv
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D7952
This commit is contained in:
Ruslan Bukin 2016-09-29 09:16:02 +00:00
parent 6c78e95a80
commit c5072d5c94
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306440

View file

@ -346,9 +346,10 @@ std::auto_ptr< atf::check::check_result >
execute_with_shell(char* const* argv)
{
const std::string cmd = flatten_argv(argv);
const std::string shell = atf::env::get("ATF_SHELL", ATF_SHELL);
const char* sh_argv[4];
sh_argv[0] = atf::env::get("ATF_SHELL", ATF_SHELL).c_str();
sh_argv[0] = shell.c_str();
sh_argv[1] = "-c";
sh_argv[2] = cmd.c_str();
sh_argv[3] = NULL;