From: H. Peter Anvin Date: Mon, 23 Jun 2008 02:11:28 +0000 (-0700) Subject: parsecmd: on an unknown keyword, print the unknown keyword X-Git-Tag: syslinux-3.70-pre21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsyslinux-3.70-pre21;p=platform%2Fupstream%2Fsyslinux.git parsecmd: on an unknown keyword, print the unknown keyword Print the unknown keyword if we run into one. --- 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