abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit fdd0c4163ffc8e30f0643af8f76457b89428bfd3
parent 598fdc396f5b77a3b929493c098d9a896750d2bd
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu,  7 Jan 2016 23:47:25 +0100

Use the shell to execute default command given by $ABDUCO_CMD

This allows to specify a default command with arguments as in:

 $ ABDUCO_CMD="dvtm -m ^b" abduco -c demo

Diffstat:
abduco.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/abduco.c b/abduco.c @@ -617,9 +617,11 @@ int main(int argc, char *argv[]) { cmd = &argv[optind + 1]; if (!cmd) { - cmd = (char*[]){ getenv("ABDUCO_CMD"), NULL }; - if (!cmd[0]) - cmd[0] = "dvtm"; + char *default_cmd = getenv("ABDUCO_CMD"); + if (default_cmd) + cmd = (char*[]){ "/bin/sh", "-c", default_cmd, NULL }; + else + cmd = (char*[]){ "dvtm", NULL }; } if (!action && !server.session_name)