From a656497a6207da8a92f57e87bf7016a5fd1b25d0 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 16 Sep 2021 14:26:49 -0400 Subject: plaparse: Fix regression caused by parser eating '#' comment characters --- src/lib/util/plaparse.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib/util/plaparse.cpp b/src/lib/util/plaparse.cpp index 798abf41c23..dfcf3dc8e80 100644 --- a/src/lib/util/plaparse.cpp +++ b/src/lib/util/plaparse.cpp @@ -99,7 +99,7 @@ static uint32_t suck_number(util::random_read &src) process_terms - process input/output matrix -------------------------------------------------*/ -static bool process_terms(jed_data *data, util::random_read &src, uint8_t &ch, parse_info *pinfo) +static bool process_terms(jed_data *data, util::random_read &src, uint8_t ch, parse_info *pinfo) { uint32_t curinput = 0; uint32_t curoutput = 0; @@ -197,12 +197,10 @@ static bool process_terms(jed_data *data, util::random_read &src, uint8_t &ch, p if (src.read(&ch, 1, actual)) return false; if (actual != 1) - { - ch = 0; - break; - } + return true; } + src.seek(-1, SEEK_CUR); return true; } @@ -353,7 +351,7 @@ int pla_parse(util::random_read &src, jed_data *result) case '0': case '1': case '-': case '~': if (!process_terms(result, src, ch, &pinfo)) return JEDERR_INVALID_DATA; - continue; + break; default: break; -- cgit v1.2.3