Skip to content
Snippets Groups Projects
Commit 5f3bfe2a authored by Recolic's avatar Recolic :house_with_garden:
Browse files

.

parent 12857675
No related branches found
No related tags found
No related merge requests found
Pipeline #1068 passed with stage
in 1 minute and 22 seconds
...@@ -33,7 +33,7 @@ namespace rlib { ...@@ -33,7 +33,7 @@ namespace rlib {
// Execute command with shell and capture stdout. // Execute command with shell and capture stdout.
// Note: stderr would be discarded. Use `2>&1` if needed. // Note: stderr would be discarded. Use `2>&1` if needed.
shell_result shell_run(const std::string& command) { inline shell_result shell_run(const std::string& command) {
char buffer[128]; char buffer[128];
FILE *pipe = popen(command.c_str(), "r"); FILE *pipe = popen(command.c_str(), "r");
...@@ -53,7 +53,7 @@ namespace rlib { ...@@ -53,7 +53,7 @@ namespace rlib {
return res; return res;
} }
auto get_shell_name() { inline auto get_shell_name() {
return shell_run("echo -n $0").stdout_; return shell_run("echo -n $0").stdout_;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment