From c03dbb3576e14a21514e3b764c92accd4595dfe5 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 22 May 2007 22:46:25 -0700 Subject: [PATCH] getc: make sure EOF is "sticky" Make sure to keep all the counters at zero if we hit EOF, so that subsequent calls will also hit EOF (we rely on that in some places.) --- getc.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/getc.inc b/getc.inc index 2db6858..610d01b 100644 --- a/getc.inc +++ b/getc.inc @@ -148,6 +148,11 @@ getc: jmp .got_data .empty: + ; CX == 0 at this point; gc_bufbytes was clobbered + ; by the subtract; we need to restore it to zero so + ; we will continue to get EOF on any further attempts + ; to read the file. + mov [di+gc_bufbytes],cx popad stc jmp .ret -- 2.7.4