aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2005-08-18 23:43:02 +0000
committerhpa <hpa>2005-08-18 23:43:02 +0000
commitd44e897d06de45c9a91c21d71f1375efb019db17 (patch)
tree8eee3839a4ca91a2b7970cf0d5c3faa9f39dbbdb
parent4c9edee7a68021fcfbc91e279342678b7f2c4d6d (diff)
downloadsyslinux-d44e897d06de45c9a91c21d71f1375efb019db17.tar.gz
syslinux-d44e897d06de45c9a91c21d71f1375efb019db17.tar.xz
syslinux-d44e897d06de45c9a91c21d71f1375efb019db17.zip
Better NOESCAPE; handle comments without space (too common a mistake)
-rw-r--r--NEWS1
-rw-r--r--abort.inc6
-rw-r--r--keywords1
-rw-r--r--keywords.inc3
-rw-r--r--parsecmd.inc4
-rw-r--r--parseconfig.inc8
-rw-r--r--ui.inc19
7 files changed, 22 insertions, 20 deletions
diff --git a/NEWS b/NEWS
index a19fd686..54a880b8 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Changes in 3.10:
* New API call to query features.
* Fix for bug in EBIOS code discovered by Arwin Vosselman.
* NOESCAPE security fix.
+ * Comments are now recognized even without a space following #.
Changes in 3.09:
* gcc4 compilation fix.
diff --git a/abort.inc b/abort.inc
index 25598d3f..850a2664 100644
--- a/abort.inc
+++ b/abort.inc
@@ -61,10 +61,8 @@ abort_check:
sti
call cwritestr ; Expects SI -> error msg
- ; If NOESCAPE is active, then execute the default command
- cmp byte [KbdFlagMask],0
- jz auto_boot ; Default command
- jmp enter_command ; Otherwise command prompt
+ ; Return to the command prompt
+ jmp enter_command
;
; End of abort_check
diff --git a/keywords b/keywords
index 155a4e19..1fa8c9cc 100644
--- a/keywords
+++ b/keywords
@@ -1,4 +1,3 @@
-# hash
menu
append
default
diff --git a/keywords.inc b/keywords.inc
index 6f68554e..e880154a 100644
--- a/keywords.inc
+++ b/keywords.inc
@@ -44,7 +44,6 @@ keywd_size equ 8 ; Bytes per keyword
align 4, db 0
keywd_table:
- keyword hash, pc_comment
keyword menu, pc_comment
keyword append, pc_append
keyword default, pc_default
@@ -62,7 +61,7 @@ keywd_table:
keyword ontimeout, pc_ontimeout
keyword onerror, pc_onerror
keyword allowoptions, pc_setint16, AllowOptions
- keyword noescape, pc_noescape
+ keyword noescape, pc_setint16, NoEscape
keyword f1, pc_fkey, FKeyName+(0<<FILENAME_MAX_LG2)
keyword f2, pc_fkey, FKeyName+(1<<FILENAME_MAX_LG2)
keyword f3, pc_fkey, FKeyName+(2<<FILENAME_MAX_LG2)
diff --git a/parsecmd.inc b/parsecmd.inc
index 8d0de95e..65a58ad3 100644
--- a/parsecmd.inc
+++ b/parsecmd.inc
@@ -36,6 +36,10 @@ getcommand:
jz .eof ; End of file
jc .find ; End of line: try again
+ ; Do this explicitly so #foo is treated as a comment
+ cmp al,'#' ; Leading hash mark -> comment
+ je .skipline
+
or al,20h ; Convert to lower case
movzx ebx,al ; Hash for a one-char keyword
.read_loop:
diff --git a/parseconfig.inc b/parseconfig.inc
index 1e5ff5f2..32e84beb 100644
--- a/parseconfig.inc
+++ b/parseconfig.inc
@@ -276,13 +276,6 @@ pc_say: call pc_getline ; "say" command
jmp crlf ; tailcall
;
-; "noescape" command
-;
-pc_noescape:
- mov byte [KbdFlagMask],0 ; No escape route available...
- ; Fall into pc_getline
-
-;
; Comment line
;
pc_comment: ; Fall into pc_getline
@@ -359,6 +352,7 @@ OnerrorLen dw 0 ; Bytes in onerror command
KbdTimeOut dw 0 ; Keyboard timeout (if any)
CmdLinePtr dw cmd_line_here ; Command line advancing pointer
ForcePrompt dw 0 ; Force prompt
+NoEscape dw 0 ; No escape
AllowImplicit dw 1 ; Allow implicit kernels
AllowOptions dw 1 ; User-specified options allowed
SerialPort dw 0 ; Serial port base (or 0 for no serial port)
diff --git a/ui.inc b/ui.inc
index 968f778b..92bf4982 100644
--- a/ui.inc
+++ b/ui.inc
@@ -20,13 +20,15 @@ no_config_file:
; Check whether or not we are supposed to display the boot prompt.
;
check_for_key:
- cmp word [ForcePrompt],byte 0 ; Force prompt?
+ cmp word [ForcePrompt],0 ; Force prompt?
jnz enter_command
- mov al,[KbdFlags]
- test al,[KbdFlagMask]
+ test byte [KbdFlags],5Bh ; Shift Alt Caps Scroll
jz auto_boot ; If neither, default boot
enter_command:
+ cmp word [NoEscape],0 ; If NOESCAPE, no prompt,
+ je auto_boot ; always run default cmd
+
mov si,boot_prompt
call cwritestr
@@ -183,12 +185,20 @@ fk_wrcmd:
call cwritestr ; Write command line so far
fk_nofile: pop di
jmp short get_char_2
+
+;
+; Jump here to run the default command line
+;
auto_boot:
mov si,default_cmd
mov di,command_line
mov cx,(max_cmd_len+4) >> 2
rep movsd
jmp short load_kernel
+
+;
+; Jump here when the command line is completed
+;
command_done:
call crlf
cmp di,command_line ; Did we just hit return?
@@ -486,9 +496,6 @@ kernel_good:
%endif
; Otherwise Linux kernel
- section .data
-KbdFlagMask db 5Bh ; Caps, Scroll, Shift, Alt
-
section .bss
alignb 2
KernelExtPtr resw 1 ; During search, final null pointer