summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-22 19:11:28 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-22 19:11:28 -0700
commitc66981883b45cd493a4312360db7ce09dfa0695e (patch)
tree4dd91aa2b25a92bfd2c92160c76f701ea64004d7
parent547c6d204612410e1208dc1a16135809b9e4daca (diff)
downloadsyslinux-c66981883b45cd493a4312360db7ce09dfa0695e.tar.gz
parsecmd: on an unknown keyword, print the unknown keywordsyslinux-3.70-pre21
Print the unknown keyword if we run into one.
-rw-r--r--core/parsecmd.inc17
1 files changed, 13 insertions, 4 deletions
diff --git a/core/parsecmd.inc b/core/parsecmd.inc
index 0c44eaf4..9ffc10d2 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