load: Handle EOF correctly
authorPetri Lehtinen <petri@digip.org>
Tue, 8 Sep 2009 13:22:16 +0000 (16:22 +0300)
committerPetri Lehtinen <petri@digip.org>
Tue, 8 Sep 2009 13:41:07 +0000 (16:41 +0300)
commit0f62dac6272e30fa33c59ba97d51dafb06bf12ee
tree82be5fe40d0a05478176481ba691d42d2a7ec25a
parentab2d93b72486eda30e868b226bec5dcd5ec3273e
load: Handle EOF correctly

In stream_get(), EOF never got it to stream->buffer and because of
this, stream_unget() failed on some situations. This patch makes
stream_get() handle EOF just like any other byte.

As a "side effect", lex_scan_string() now needs to unget the EOF, or
otherwise it ends up in error message on premature end of input.
src/load.c