From 81e4821f2a9507238cfda0c665933eb8a23c9c5b Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 22 Jul 2008 13:41:07 -0400 Subject: Simplify and fix label string scanning Simplify and fix bugs in the code to store and match label names without filename mangling. Signed-off-by: H. Peter Anvin --- core/ui.inc | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'core/ui.inc') diff --git a/core/ui.inc b/core/ui.inc index 0ff9d104..26b6fa09 100644 --- a/core/ui.inc +++ b/core/ui.inc @@ -309,24 +309,18 @@ vk_check: sub di,cx ; Return to beginning of buf push si mov si,command_line - mov cx,FILENAME_MAX .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 + jbe .done + scasb + je .loop .nomatch: pop si jmp .scan .done: + cmp byte [di],0 ; Must match end of string + jne .nomatch pop si ; -- cgit v1.2.1