commit 20f5abcdc25663213924830693966b6df2748d8a
parent 2f89fafd55271eceb2f2515c8a38acd977740b3e
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Wed, 23 Dec 2020 18:06:17 -0800
Print the cache whenever it's created
Diffstat:
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/main.c b/main.c
@@ -312,12 +312,14 @@ splitrun(filter **filters, int argc, const char **argv, unsigned int index, char
if (n != 4 && (n < 4 || n > 5 || strcmp(item[GI_PLUS], "+") != 0))
return UNWIND;
- for (i = 0; filters[i] != NULL; ++i) {
- n = filters[i](argc, argv, index, (const char **)item);
- if (n <= 0)
- return n;
- argc -= n;
- argv += n;
+ if (filters != NULL) {
+ for (i = 0; filters[i] != NULL; ++i) {
+ n = filters[i](argc, argv, index, (const char **)item);
+ if (n <= 0)
+ return n;
+ argc -= n;
+ argv += n;
+ }
}
return func(argc, argv, index, (const char **)item);
@@ -637,6 +639,7 @@ gawk(const char **addr)
mycache = 1;
if (gph_write(addr, cache) == 1)
return 0; /* let the user handle it */
+ run_filters(cache, NULL, 0, NULL, cprintn);
}
/* NOTE: do not return until --depth */