diff options
author | sin <sin@2f30.org> | 2019-08-22 15:09:29 +0100 |
---|---|---|
committer | sin <sin@2f30.org> | 2019-08-22 17:21:29 +0100 |
commit | 58edea240e40eeb006923f012a6bb792fb8ef8a7 (patch) | |
tree | 8c3a04522acecc24a2cba5dc66af97389f678b9e /nopen.c | |
parent | 784551aa55ff996e103443d1bbe65684fd4d7463 (diff) | |
download | noice-58edea240e40eeb006923f012a6bb792fb8ef8a7.tar.gz |
Fix spawn*() so it can report errors to the caller
If nopen is not in PATH, noice will briefly print a warning about it
so the user knows.
Also, add NOPENCMD define in noiceconf.def.h to specify the default
plumber program.
Diffstat (limited to 'nopen.c')
-rw-r--r-- | nopen.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -21,7 +21,7 @@ struct assoc { #include "nopenconf.h" void -spawnassoc(struct assoc *assoc, char *arg) +run(struct assoc *assoc, char *arg) { char *argv[NR_ARGS]; int i; @@ -46,7 +46,6 @@ openwith(char *file) if (regexec(&assocs[i].regcomp, file, 0, NULL, 0) == 0) return &assocs[i]; } - return NULL; } @@ -88,7 +87,7 @@ main(int argc, char *argv[]) if ((assoc = openwith(argv[0])) == NULL) continue; - spawnassoc(assoc, argv[0]); + run(assoc, argv[0]); } return 0; } |