[syslinux] [PATCH] parseconfig, ui: store the label name unmangled

Sebastian Herbszt herbszt at gmx.de
Tue Jul 22 08:09:55 PDT 2008


Store the label names unmangled and match those against command_line.

- Sebastian

Index: syslinux-3.71-pre15/core/parseconfig.inc
===================================================================
--- syslinux-3.71-pre15.orig/core/parseconfig.inc	2008-07-22 16:32:48.000000000 +0200
+++ syslinux-3.71-pre15/core/parseconfig.inc	2008-07-22 16:33:44.000000000 +0200
@@ -307,7 +307,16 @@
 		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
Index: syslinux-3.71-pre15/core/ui.inc
===================================================================
--- syslinux-3.71-pre15.orig/core/ui.inc	2008-07-22 16:32:48.000000000 +0200
+++ syslinux-3.71-pre15/core/ui.inc	2008-07-22 16:32:58.000000000 +0200
@@ -308,12 +308,26 @@
 
 		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"




More information about the Syslinux mailing list