sys-file-reader: get_text_token did not set delimiter - bug #58943
authorFriedrich Beckmann <friedrich.beckmann@gmx.de>
Fri, 14 Aug 2020 00:53:11 +0000 (02:53 +0200)
committerFriedrich Beckmann <friedrich.beckmann@gmx.de>
Fri, 14 Aug 2020 00:53:11 +0000 (02:53 +0200)
commit8c76dd167f2b63b3c97606c53667c391c17fae10
treefc0d52ff54ff7ee5343c7d380fe1b676fdd5661a
parente45cdf7b0e1b1b9ef41df8ce91fe65e3f944ea61
sys-file-reader: get_text_token did not set delimiter - bug #58943

parse_mrsets used loop local variables which were not initialized.
The regression worked with low compiler optimization levels because
the value for "delimiter" was kept over the loop iterations.
get_text_token did not set the delimiter value when only delimiters
are left in the string. I set the delimiter value to the last value
in the string in that case. I initialized the variables to see the
bug also in -O0.

Closes: https://savannah.gnu.org/bugs/?58943
src/data/sys-file-reader.c
src/libpspp/str.c