Skip to contentSkip to conversation

script bug

DISCUSSION Yoshinori K. Okuji 2 participants 3 messages May 7, 2006

lore
Share & tools
lore
#0 lore raw

Try something like this:

@ "extremely long long line............................................................." { }

grub-emu segfaults. This is partially because of the menu code, partilaly because of the scripting engine code. The menu code currently limits the max number of characters per line to 100 (very bad). So get_line chops the line, then the scripting engine cannot deal with the malformed line. Both must be fixed.

Okuji

#1 lore raw
Quoted 11 lines · Yoshinori K. Okuji

Try something like this:

@ "extremely long long line............................................................." { }

grub-emu segfaults. This is partially because of the menu code, partilaly because of the scripting engine code. The menu code currently limits the max number of characters per line to 100 (very bad). So get_line chops the line, then the scripting engine cannot deal with the malformed line. Both must be fixed.

Yeah, the get_line was broken from the beginning... I think it should be even possible to remove this function because we do not really need it.

As for scripting, I will test it in about two weeks. At the moment I have very little time. :-/

--
Marco

#2 lore raw
Quoted 3 lines · Marco Gerards

Yeah, the get_line was broken from the beginning... I think it should be even possible to remove this function because we do not really need it.

I believe that get_line should be kept. Suppose that you have this kind of config file:

1: do something
2: do another thing
3: do yet another thing

To execute these lines, it is not necessary to keep all the three lines in memory, since they can be executed line by line. You can say that the consumed memory is not that much, but I don't think this is a good way of programming. Whenever possible, I think it is better to save memory.

BTW, could you describe how the scripting engine is supposed to work? For example, suppose that you have this (the syntax is not very important here):

if test -f /boot/kernel; then
kernel /boot/kernel
fi

Is it possible to tell a line at a time to the scripting engine, and let it execute this code block once "fi" is inputted? BASH deals with command lines in this way.

Okuji