Added 2>&1
This commit is contained in:
parent
a7b45c2d99
commit
ee30308081
8
tools.h
8
tools.h
@ -353,6 +353,14 @@ char *tool_function_linux_terminal(char *command) {
|
||||
size_t total_size = 0;
|
||||
char *output = NULL;
|
||||
|
||||
char stderr_command[1024] = {0};
|
||||
|
||||
if(!strstr(command, "2>")) {
|
||||
snprintf(stderr_command, sizeof(stderr_command), "%s 2>&1", command);
|
||||
command = stderr_command;
|
||||
}
|
||||
|
||||
|
||||
fp = popen(command, "r");
|
||||
if (fp == NULL) {
|
||||
perror("popen failed");
|
||||
|
Loading…
Reference in New Issue
Block a user