Skip to content

Commit

Permalink
Fix bug in undefer_input() that misplaced the input state.
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Jun 12, 2019
1 parent 075867b commit 41beb47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,10 @@ void undefer_input(__G)
* This condition was checked when G.incnt_leftover was set > 0 in
* defer_leftover_input(), and it is NOT allowed to touch G.csize
* before calling undefer_input() when (G.incnt_leftover > 0)
* (single exception: see read_byte()'s "G.csize <= 0" handling) !!
* (single exception: see readbyte()'s "G.csize <= 0" handling) !!
*/
if (G.csize < 0L)
G.csize = 0L;
G.incnt = G.incnt_leftover + (int)G.csize;
G.inptr = G.inptr_leftover - (int)G.csize;
G.incnt_leftover = 0;
Expand Down

0 comments on commit 41beb47

Please sign in to comment.