segment: Fix behavior when #! line is not new-line terminated.
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 26 Nov 2018 14:54:52 +0000 (06:54 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 26 Nov 2018 14:54:52 +0000 (06:54 -0800)
commitfe94912b9c8682c4666873b84c83cda88f4c135d
tree39e6d9cd91e4e660fca1faacb9a07a30a08a746b
parentc8297b870c691e213d87c43f892bd2a24bb64ec2
segment: Fix behavior when #! line is not new-line terminated.

The code here is supposed to maintain a invariant that, when it returns a
nonnegative value, it initializes *type, but it failed to do that when a
#! line did not end in a new-line.  This fixes the problem.

Bug #55101.
Thanks for Friedrich Beckmann for narrowing down the problem.
Found by the Debian buildd: https://buildd.debian.org/status/fetch.php?pkg=pspp&arch=arm64&ver=1.2.0-1&stamp=1543183214&raw=0
src/language/lexer/segment.c