[syslinux] store the label name unmangled
H. Peter Anvin
hpa at zytor.com
Mon Jul 21 16:03:48 PDT 2008
Sebastian Herbszt wrote:
>>
>> The right thing to do is really to remove this one last link between
>> label names and filenames and store the label name unmangled. This also
>> means matching labels *before* mangling the name, i.e. to match from
>> command_line instead of KernelName using a comparison which can
>> understand end of character (the code that needs replacement is ui.inc,
>> lines 311-313),
>
> 310 push si
> 311 mov si,KernelName
> 312 mov cx,FILENAME_MAX
> 313 es repe cmpsb
> 314 pop si
>
> It looks like command_line can contain spaces and be longer than
> FILENAME_MAX. mangle_name seems to take care of this for KernelName.
> So this "custom compare" should compare up to FILENAME_MAX chars
> and end on char <= ' '.
Yup.
I can do this early post 3.71.
>> and to just length-check the label name rather than
>> mangling it (parseconfig.inc, line 310).
>
> 308 call pc_getline
> 309 mov di,VKernelBuf+vk_vname
> 310 call mangle_name ; Mangle virtual name
> 311 mov byte [VKernel],1 ; We've seen a "label" statement
> 312 mov si,VKernelBuf+vk_vname ; By default, rname == vname
> 313 mov di,VKernelBuf+vk_rname
> 314 mov cx,FILENAME_MAX
> 315 rep movsb
>
> Same seems to apply here. It should copy up to FILENAME_MAX chars from
> si to di and break on char <= ' '.
> Did i miss anything?
Nope, that's pretty much it.
-hpa
More information about the Syslinux
mailing list