summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/command.c b/command.c
index 9701408..2f81eaa 100644
--- a/command.c
+++ b/command.c
@@ -17,7 +17,8 @@ command_is_prefix(struct command *cmd) {
void
command_exec(struct command *cmd) {
- execlp("/bin/sh", "sh", "-c", cmd->name, (char *) 0);
+ const char *cmdname = cmd->command == NULL ? cmd->name : cmd->command;
+ execlp("/bin/sh", "sh", "-c", cmdname, (char *) 0);
err(1, "executing command %s", cmd->name);
}