diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-02-12 15:48:25 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-02-12 15:48:25 -0800 |
commit | c9e35f37217f25f1f576754df464a8ec0d6d22fe (patch) | |
tree | f7448dfe918207f0f2429112fd5846be9a0d7f22 | |
parent | 2ad6602fb7401b415b058f5dcf70f377b9113412 (diff) | |
download | syslinux-c9e35f37217f25f1f576754df464a8ec0d6d22fe.tar.gz |
getc: don't clobber AH; return CF=1, AL=0 on end of file
Don't clobber AH when calling getc; when returning with CF=1 (EOF),
always return with AL=0.
-rw-r--r-- | getc.inc | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -100,8 +100,9 @@ getc: and bx,bx jnz .have_unget - mov ax,real_mode_seg ; Borrow the real_mode_seg - mov es,ax + mov si,real_mode_seg ; Borrow the real_mode_seg + mov es,si + .got_data: sub word [di+gc_bufbytes],1 jc .get_data ; Was it zero already? @@ -154,6 +155,7 @@ getc: ; to read the file. mov [di+gc_bufbytes],cx popad + xor al,al ; Return a predictable zero stc jmp .ret |