#define PROGRESS_BAR_LEN 20
#endif
-/* template to run shell command for vimb command :shellcmd */
-#define SHELL_CMD "/bin/sh -c '%s'"
-
#endif /* end of include guard: _CONFIG_H */
static gboolean ex_shellcmd(const ExArg *arg)
{
int status;
- char *cmd, *stdOut = NULL, *stdErr = NULL;
+ char *stdOut = NULL, *stdErr = NULL;
gboolean success;
GError *error = NULL;
return false;
}
- cmd = g_strdup_printf(SHELL_CMD, arg->rhs->str);
if (arg->bang) {
- if (!g_spawn_command_line_async(cmd, &error)) {
+ if (!g_spawn_command_line_async(arg->rhs->str, &error)) {
g_warning("Can't run '%s': %s", arg->rhs->str, error->message);
g_clear_error(&error);
success = false;
success = true;
}
} else {
- if (!g_spawn_command_line_sync(cmd, &stdOut, &stdErr, &status, &error)) {
+ if (!g_spawn_command_line_sync(arg->rhs->str, &stdOut, &stdErr, &status, &error)) {
g_warning("Can't run '%s': %s", arg->rhs->str, error->message);
g_clear_error(&error);
success = false;
}
}
- g_free(cmd);
return success;
}