From bdec516cbccd4a88377f1df0602a65cc91a03c4d Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 27 Feb 2007 22:15:29 -0800 Subject: [PATCH] Correctly ignore TEXT blocks. --- parseconfig.inc | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/parseconfig.inc b/parseconfig.inc index 987ed2a..95a9797 100644 --- a/parseconfig.inc +++ b/parseconfig.inc @@ -316,23 +316,19 @@ pc_say: call pc_getline ; "say" command pc_text: call pc_getline ; Ignore rest of line .loop: call pc_getline -.skipspace: - lodsb - and al,al - jz .loop - cmp al,' ' - jbe .skipspace - - dec si + jc .eof + + ; Leading spaces are already removed... lodsd - and eax,0xfdfdfdfd + and eax,0xdfdfdfdf ; Upper case cmp eax,'ENDT' jne .loop lodsd - and eax,0x00fdfdfd + and eax,0x00dfdfdf ; Upper case and mask cmp eax,'EXT' jne .loop ; If we get here we hit ENDTEXT +.eof: ret ; @@ -342,12 +338,12 @@ pc_comment: ; Fall into pc_getline ; ; Common subroutine: load line into trackbuf; returns with SI -> trackbuf +; CF is set on EOF. ; pc_getline: mov di,trackbuf push di call getline - xor al,al - stosb ; Null-terminate + mov byte [di],0 ; Null-terminate pop si ret -- 2.7.4