commit 49b468652779baf59e0c76b34dcbef80367ca1ed
parent ad8003e6580c65dff0411539d4d4a3fb16a653a0
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Tue, 22 Dec 2020 02:24:44 -0800
Fix EOF causing error
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/main.c b/main.c
@@ -667,17 +667,18 @@ gawk(const char *host, const char *path, const char *port)
}
}
- --depth;
-
if (mycache && unlink(cache) == -1)
warn("unable to unlink '%s'", cache);
+ if (feof(stdin)) {
+ done = depth;
+ }
+
+ --depth;
if (ferror(stdin)) {
warn("'%s'", "/dev/stdin");
return -1;
}
- if (feof(stdin))
- done = depth;
return done - 1;
}