commit 8e5f7389c0cff016dbe48439998f615ad1b899b8
parent 1751fa702d6c936df8b8cfbb76ce330f1bb02847
Author: William Casarin <jb55@jb55.com>
Date: Fri, 14 Jun 2019 00:16:10 -0700
decompile: dont fail on first error
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
@@ -206,13 +206,16 @@ int main(int argc, const char *argv[])
ssize_t len = 0;
size_t n;
int ok;
+ bool failed = false;
if (input == NULL) {
while ((len = getline(&line, &n, stdin)) != -1) {
ok = decompile(line, len-1, abbrev_data);
- if (!ok)
- fail(5, "failed to decompile");
+ if (!ok) {
+ failed = true;
+ fprintf(stderr, "failed to decompile\n");
+ }
}
}
else {
@@ -223,6 +226,9 @@ int main(int argc, const char *argv[])
}
+ if (failed)
+ exit(5);
+
}
else {