summaryrefslogtreecommitdiff
path: root/core/ui.inc
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-07-22 13:41:07 -0400
committerH. Peter Anvin <hpa@zytor.com>2008-07-22 13:41:07 -0400
commit81e4821f2a9507238cfda0c665933eb8a23c9c5b (patch)
tree1d99fe1dc737a4967de7ccc4728b2b1391184af9 /core/ui.inc
parent559ea7abec1acb497eca0bd74a583713e425302b (diff)
downloadsyslinux-81e4821f2a9507238cfda0c665933eb8a23c9c5b.tar.gz
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 <hpa@zytor.com>
Diffstat (limited to 'core/ui.inc')
-rw-r--r--core/ui.inc16
1 files changed, 5 insertions, 11 deletions
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
;