summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-11-24 11:47:31 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-11-24 11:47:31 -0800
commit8f9ab607b397678ffbffc4e3a5f063f439312e25 (patch)
treedbce24615f7892232d18a243f4caef37358a0a3e /struct.c
parentb769f987e089c4b5312b607f973bfe20e3c14ade (diff)
downloadtxr-8f9ab607b397678ffbffc4e3a5f063f439312e25.tar.gz
txr-8f9ab607b397678ffbffc4e3a5f063f439312e25.tar.bz2
txr-8f9ab607b397678ffbffc4e3a5f063f439312e25.zip
listener: fix buggy balanced line check.
* parser.c (is_balanced_line): When handling the closing characters, we must look for the state type which matches the character type, not state[sp]. Of course state[sp] == match, since we initialized it that way, and so state[sp] != match is always false. We want match to be derived from the character ch, not from state[sp]. Also, the polarity in the match-not-found return case is wrong; we must return 0.
Diffstat (limited to 'struct.c')
0 files changed, 0 insertions, 0 deletions