diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-07-02 15:55:37 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-07-02 15:55:37 -0700 |
commit | 94ed05fe4df6a657884596bdabd03c7666a63de7 (patch) | |
tree | c042d25de944ff850b4a6dc67fec719d90ed5904 | |
parent | 6863c8e2a90e8d6a2d6d284922f115f2020dbb0d (diff) | |
download | cppawk-94ed05fe4df6a657884596bdabd03c7666a63de7.tar.gz cppawk-94ed05fe4df6a657884596bdabd03c7666a63de7.tar.bz2 cppawk-94ed05fe4df6a657884596bdabd03c7666a63de7.zip |
loop: records: don't loop if file can't be oopened.
-rw-r--r-- | cppawk-include/iter.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cppawk-include/iter.h b/cppawk-include/iter.h index e2bdeac..53bb43f 100644 --- a/cppawk-include/iter.h +++ b/cppawk-include/iter.h @@ -321,7 +321,7 @@ function __loop_argmin(a, arga, b, argb) #define __temp_records(file) __g(stream) #define __init_records(file) __g(stream) = file -#define __test_records(file) getline < __g(stream) +#define __test_records(file) (getline < __g(stream)) > 0 #define __prep_records(file) 1 #define __fini_records(file) __g(stream) != "-" ? close(__g(stream)) : 1 #define __step_records(file) 1 |