From c66981883b45cd493a4312360db7ce09dfa0695e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 22 Jun 2008 19:11:28 -0700 Subject: [PATCH] parsecmd: on an unknown keyword, print the unknown keyword Print the unknown keyword if we run into one. --- core/parsecmd.inc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/core/parsecmd.inc b/core/parsecmd.inc index 0c44eaf..9ffc10d 100644 --- a/core/parsecmd.inc +++ b/core/parsecmd.inc @@ -39,20 +39,25 @@ getcommand: cmp al,'#' ; Leading hash mark -> comment je .skipline + ; Abuse the trackbuf by putting the keyword there for + ; possible error messaging... + mov di,trackbuf + stosb or al,20h ; Convert to lower case movzx ebx,al ; Hash for a one-char keyword .read_loop: - push ebx call getc - pop ebx jc .eof cmp al,' ' ; Whitespace jbe .done + stosb or al,20h rol ebx,5 xor bl,al jmp short .read_loop .done: call ungetc + xor ax,ax + stosb ; Null-terminate the trackbuf call skipspace jz .eof jc .noparm @@ -68,7 +73,11 @@ getcommand: ; Otherwise unrecognized keyword mov si,err_badcfg - jmp short .error + call writestr + mov si,trackbuf + call writestr + call crlf + jmp short .skipline ; No parameter .noparm: @@ -93,7 +102,7 @@ getcommand: jmp short .skipline section .data -err_badcfg db 'Unknown keyword in configuration file.', CR, LF, 0 +err_badcfg db 'Unknown keyword in configuration file: ',0 err_noparm db 'Missing parameter in configuration file.', CR, LF, 0 section .uibss -- 2.7.4