mirror of
https://github.com/AGWA/git-crypt.git
synced 2025-12-27 13:13:20 -08:00
New exec_command() that takes command as array instead of string
This abstracts away the details of argument quoting, which differs between Unix and Windows. Also replace all uses of the system() library call with exec_command(). Although system() exists on Windows, it executes the command via cmd.exe, which has ridiculous escaping rules.
This commit is contained in:
@@ -102,12 +102,17 @@ std::string our_exe_path () // TODO
|
||||
return argv0;
|
||||
}
|
||||
|
||||
int exec_command (const char* command, std::ostream& output) // TODO
|
||||
int exec_command (const std::vector<std::string>& command) // TODO
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int exec_command_with_input (const char* command, const char* p, size_t len) // TODO
|
||||
int exec_command (const std::vector<std::string>& command, std::ostream& output) // TODO
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int exec_command_with_input (const std::vector<std::string>& command, const char* p, size_t len) // TODO
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user