diff options
| author | Louis Burda <dev@sinitax.com> | 2025-12-05 00:01:15 +0100 |
|---|---|---|
| committer | Louis Burda <dev@sinitax.com> | 2025-12-05 00:01:15 +0100 |
| commit | bfb45392089ed1f245e22697d3cc80a216e03ccf (patch) | |
| tree | e5abde5837b99c60a7b5d5692c51d1925c262a70 | |
| parent | 02706c7b5ed189077478a10cc3e27080b6fd1f61 (diff) | |
| download | tquery-master.tar.gz tquery-master.zip | |
| -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++) { |
