@@ -1385,10 +1385,8 @@ namespace webui{
13851385
13861386 // boost::process::environment env = ::boost::this_process::environment();
13871387 // boost::process::child c(cmd, browser::env, boost::process::windows::hide);
1388- boost::process::child c (cmd);
1389-
1390- c.wait ();
1391- return c.exit_code ();
1388+ return boost::process::system (cmd);
1389+
13921390 }
13931391
13941392 int command_browser (std::string cmd){
@@ -1626,7 +1624,7 @@ namespace webui{
16261624 #ifdef _WIN32
16271625 return WinUserProfile;
16281626 #elif __APPLE__
1629- char * tmpdir = std::getenv (" TMPDIR" );
1627+ char * tmpdir = std::getenv (" TMPDIR" );
16301628 return tmpdir;
16311629 #else
16321630 return " /var/tmp" ;
@@ -1678,9 +1676,9 @@ namespace webui{
16781676 if (!folder_exist (temp + webui::sep + profile_name)){
16791677
16801678 #ifdef _WIN32
1681- browser::command (" cmd /c \" " + browser::browser_path + " -CreateProfile \" WebUI " + temp + webui::sep + profile_name + " \" > nul 2>&1" );
1679+ browser::command (std::string ( " cmd /c \" " ) + browser::browser_path + " -CreateProfile \" WebUI " + temp + webui::sep + profile_name + " \" > nul 2>&1" );
16821680 #else
1683- browser::command (" sh -c \" " + browser::browser_path + " -CreateProfile \" WebUI " + temp + webui::sep + profile_name + " \" >>/dev/null 2>>/dev/null \" " );
1681+ browser::command (std::string ( " " ) + browser::browser_path + " -CreateProfile " + " \" WebUI " + temp + webui::sep + profile_name + " \" " ); // we can't do escaping to redirect error .. todo
16841682 #endif
16851683 std::string buf;
16861684
@@ -1776,9 +1774,9 @@ namespace webui{
17761774 full.append (address);
17771775
17781776 #ifdef _WIN32
1779- if (browser::command_browser (" cmd /c \" " + full + " \" > nul 2>&1" ) == 0 )
1777+ if (browser::command_browser (std::string ( " cmd /c \" " ) + full + " \" > nul 2>&1" ) == 0 )
17801778 #else
1781- if (browser::command_browser (" sh -c \" " + full + " >>/dev/null 2>>/dev/null\" " ) == 0 )
1779+ if (browser::command_browser ( full + " >>/dev/null 2>>/dev/null" ) == 0 )
17821780 #endif
17831781 {
17841782 browser::CurrentBrowser = firefox;
@@ -1815,10 +1813,11 @@ namespace webui{
18151813 std::string full (p_custom->app );
18161814 full.append (arg);
18171815
1816+
18181817 #ifdef _WIN32
1819- if (browser::command_browser (" cmd /c \" " + full + " \" > nul 2>&1" ) == 0 )
1818+ if (browser::command_browser (std::string ( " cmd /c \" " ) + full + " \" > nul 2>&1" ) == 0 )
18201819 #else
1821- if (browser::command_browser (" sh -c \" " + full + " >>/dev/null 2>>/dev/null\" " ) == 0 )
1820+ if (browser::command_browser (full + " >>/dev/null 2>>/dev/null" ) == 0 )
18221821 #endif
18231822 {
18241823 browser::CurrentBrowser = custom;
@@ -1847,9 +1846,9 @@ namespace webui{
18471846 full.append (address);
18481847
18491848 #ifdef _WIN32
1850- if (browser::command_browser (" cmd /c \" " + full + " \" > nul 2>&1" ) == 0 )
1849+ if (browser::command_browser (std::string ( " cmd /c \" " ) + full + " \" > nul 2>&1" ) == 0 )
18511850 #else
1852- if (browser::command_browser (" sh -c \" " + full + " >>/dev/null 2>>/dev/null\" " ) == 0 )
1851+ if (browser::command_browser ( full + " >>/dev/null 2>>/dev/null" ) == 0 )
18531852 #endif
18541853 {
18551854 browser::CurrentBrowser = chrome;
0 commit comments