diff options
| -rw-r--r-- | tquery.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -53,7 +53,7 @@ static char hook_key_arg[6] = { 0 }; static char *hook_argv[4] = { NULL, hook_key_arg, NULL, NULL }; static bool hook_io = false; -static char *run_argv[4] = { NULL, NULL, NULL }; +static char *run_argv[3] = { NULL, NULL, NULL }; static bool run_cmd = false; static bool run_io = false; @@ -178,7 +178,7 @@ invoke(const char **argv, pid_t *pid, int *fd, bool in, bool out, bool err) close(out_pipe[1]); } execvp(argv[0], (char *const *) argv); - die("execv '%s':"); + die("execv '%s':", argv[0]); } else { if (fd) { *fd = out_pipe[0]; @@ -219,9 +219,13 @@ load(void) memcpy(output + output_len, loadbuf, (size_t) nread); if (!entries_cap) - entries = addcap(entries, sizeof(struct entry), - 1, &entries_cap); - entries_len = MAX(1, entries_len); + entries = addcap(entries, sizeof(struct entry), 1, &entries_cap); + + if (!entries_len) { + entries[0].full = 0; + entries[0].visible = 0; + entries_len = 1; + } c = output + output_len; for (i = output_len; i < output_len + (size_t) nread; i++, c++) { |
