Am 03.03.2012 19:20, schrieb Vladimir 'φ-coder/phcoder' Serbinenko:
> On 03.03.2012 19:10, Andreas Vogel wrote:
>>> Hi,
>>>
>>> This code in menu.c::menuentry_eq() looks wrong:
>>>
>>> {
>>> const char *ptr1, *ptr2;
>>> ptr1 = title;
>>> ptr2 = spec;
>>> while (1)
>>> {
>>> if (*ptr2 == '>'&& ptr2[1] != '>'&& *ptr1 == 0)
>>> return 1;
>>> if (*ptr2 == '>'&& ptr2[1] != '>')
>>> return 0;
>>> if (*ptr2 == '>')
>>> ptr2++;
>>> if (*ptr1 != *ptr2)
>>> return 0;
>>> if (*ptr1 == 0)<----
>>> return 1;
>>> ptr1++;
>>> ptr2++;
>>> }
>>> }
>>>
>>>
>>> Specifically, if there are two menuentries that differ by adding
>>> characters, this function will match the wrong one, i.e.:
>>>
>>> set default='entry a with more words'
>>>
>>> menuentry "entry a" {
>>> }
>>>
>>> menuentry "entry a with more words" {
>>> }
>> As far as I understand the code, using submenu references in the default
>> variable for automatic booting is not working at all.
>> This is due to the dynamic loading of submenus. When a menu is opened
>> and run, only the direct menu entries are known. Searching for menu
>> entries deeper in the menu tree is not done.
> No need. When timeout is reached the submenu is executed and first
> element is discarded and the rest is searched for again.
>
I'm sorry... and you're right! Actually the code was too obfuscated for
me...
BTW, one of the features which are missing and about what i read in
different forums is that it's not possible to reference entries in the
menu tree by number, e.g. "0>2>4>2". By reading the code i would say
it's not possible, but after my failure right now, I better ask.... :-)
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel