diff --git a/rpylib.so b/rpylib.so index 4213a40..ae413e3 100755 Binary files a/rpylib.so and b/rpylib.so differ diff --git a/tools.h b/tools.h index 2b5baff..dfd96be 100644 --- a/tools.h +++ b/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");