extlinux: actually fix the closing of a file on EOF syslinux-3.70-pre22
authorH. Peter Anvin <hpa@zytor.com>
Mon, 23 Jun 2008 04:25:44 +0000 (21:25 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 23 Jun 2008 04:25:44 +0000 (21:25 -0700)
Actually close the file properly on EOF, even if not aligned to a
sector boundary.  Sigh.

core/extlinux.asm

index 838f718..b0a8240 100644 (file)
@@ -1506,8 +1506,7 @@ getfssec:
                sub [si+file_bytesleft],ecx
                jnbe .noteof                    ; CF=0 in this case
                add ecx,[si+file_bytesleft]     ; Actual number of bytes left
-               sub [si+file_bytesleft],ecx     ; ... all read
-               xor si,si                       ; File closed
+               call close_file
                stc                             ; We hit EOF
 .noteof:
                pop edi