@@ -431,26 +431,6 @@ namespace util
431
431
}
432
432
433
433
434
- /* !
435
- * Function: join
436
- * Parameters:
437
- * [in] vec : Vector of strings which needs to be joined to form
438
- * a single string with words separated by a separator char.
439
- * [in] sep : String used to separate 2 words in the joined string.
440
- * Default constructed to ' ' (space).
441
- * [out] string: Joined string.
442
- */
443
- static inline
444
- std::string join (const std::vector<std::string>& vec,
445
- const std::string& sep = " " )
446
- {
447
- std::string res;
448
- for (auto & elem : vec) res.append (elem + sep);
449
- res.erase (--res.end ());
450
- return res;
451
- }
452
-
453
-
454
434
#ifndef __USING_WINDOWS__
455
435
/* !
456
436
* Function: set_clo_on_exec
@@ -696,11 +676,6 @@ struct session_leader {
696
676
bool leader_ = false ;
697
677
};
698
678
699
- struct shell {
700
- explicit shell (bool s): shell_(s) {}
701
- bool shell_ = false ;
702
- };
703
-
704
679
/* !
705
680
* Base class for all arguments involving string value.
706
681
*/
@@ -1011,7 +986,6 @@ struct ArgumentDeducer
1011
986
void set_option (bufsize&& bsiz);
1012
987
void set_option (environment&& env);
1013
988
void set_option (defer_spawn&& defer);
1014
- void set_option (shell&& sh);
1015
989
void set_option (input&& inp);
1016
990
void set_option (output&& out);
1017
991
void set_option (error&& err);
@@ -1350,7 +1324,6 @@ class Popen
1350
1324
bool defer_process_start_ = false ;
1351
1325
bool close_fds_ = false ;
1352
1326
bool has_preexec_fn_ = false ;
1353
- bool shell_ = false ;
1354
1327
bool session_leader_ = false ;
1355
1328
1356
1329
std::string exe_name_;
@@ -1492,10 +1465,6 @@ inline void Popen::kill(int sig_num)
1492
1465
inline void Popen::execute_process () noexcept (false )
1493
1466
{
1494
1467
#ifdef __USING_WINDOWS__
1495
- if (this ->shell_ ) {
1496
- throw OSError (" shell not currently supported on windows" , 0 );
1497
- }
1498
-
1499
1468
void * environment_string_table_ptr = nullptr ;
1500
1469
env_vector_t environment_string_vector;
1501
1470
if (this ->env_ .size ()){
@@ -1588,14 +1557,6 @@ inline void Popen::execute_process() noexcept(false)
1588
1557
int err_rd_pipe, err_wr_pipe;
1589
1558
std::tie (err_rd_pipe, err_wr_pipe) = util::pipe_cloexec ();
1590
1559
1591
- if (shell_) {
1592
- auto new_cmd = util::join (vargs_);
1593
- vargs_.clear ();
1594
- vargs_.insert (vargs_.begin (), {" /bin/sh" , " -c" });
1595
- vargs_.push_back (new_cmd);
1596
- populate_c_argv ();
1597
- }
1598
-
1599
1560
if (exe_name_.length ()) {
1600
1561
vargs_.insert (vargs_.begin (), exe_name_);
1601
1562
populate_c_argv ();
@@ -1678,10 +1639,6 @@ namespace detail {
1678
1639
popen_->defer_process_start_ = defer.defer ;
1679
1640
}
1680
1641
1681
- inline void ArgumentDeducer::set_option (shell&& sh) {
1682
- popen_->shell_ = sh.shell_ ;
1683
- }
1684
-
1685
1642
inline void ArgumentDeducer::set_option (session_leader&& sleader) {
1686
1643
popen_->session_leader_ = sleader.leader_ ;
1687
1644
}
0 commit comments