From c5072d5c9403487b92bc9f08357a9d002221f1ad Mon Sep 17 00:00:00 2001 From: Ruslan Bukin Date: Thu, 29 Sep 2016 09:16:02 +0000 Subject: [PATCH] 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 --- contrib/atf/atf-sh/atf-check.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/atf/atf-sh/atf-check.cpp b/contrib/atf/atf-sh/atf-check.cpp index 866b7bb483a2..414b64ea91f0 100644 --- a/contrib/atf/atf-sh/atf-check.cpp +++ b/contrib/atf/atf-sh/atf-check.cpp @@ -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;