From 559ea7abec1acb497eca0bd74a583713e425302b Mon Sep 17 00:00:00 2001 From: Sebastian Herbszt Date: Tue, 22 Jul 2008 17:09:55 +0200 Subject: [PATCH] parseconfig, ui: store the label name unmangled Store the label names unmangled and match those against command_line. - Sebastian Signed-off-by: H. Peter Anvin --- core/parseconfig.inc | 11 ++++++++++- core/ui.inc | 20 +++++++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/core/parseconfig.inc b/core/parseconfig.inc index 7fb6ddf..843a733 100644 --- a/core/parseconfig.inc +++ b/core/parseconfig.inc @@ -307,7 +307,16 @@ pc_label: call commit_vk ; Commit any current vkernel rep stosw call pc_getline mov di,VKernelBuf+vk_vname - call mangle_name ; Mangle virtual name + mov cx,FILENAME_MAX-1 +.loop: + lodsb + cmp al,' ' + jna .done + mov [di],al + inc di + dec cx + jnz .loop +.done: mov byte [VKernel],1 ; We've seen a "label" statement mov si,VKernelBuf+vk_vname ; By default, rname == vname mov di,VKernelBuf+vk_rname diff --git a/core/ui.inc b/core/ui.inc index f593ce1..0ff9d10 100644 --- a/core/ui.inc +++ b/core/ui.inc @@ -308,12 +308,26 @@ vk_check: sub di,cx ; Return to beginning of buf push si - mov si,KernelName + mov si,command_line mov cx,FILENAME_MAX - es repe cmpsb +.loop: + dec cx + jz .done + lodsb + mov ah,[di] + inc di + cmp ah,al + je .match + jmp .nomatch +.match: + cmp al,' ' + jna .done + jmp .loop +.nomatch: pop si - je .found jmp .scan +.done: + pop si ; ; We *are* using a "virtual kernel" -- 2.7.4