2004-12-29 Marco Gerards <metgerards@student.han.nl>

* normal/cmdline.c (grub_cmdline_get): Redone logic so no empty
	lines are inserted and make it work like readline.  Reported by
	Vincent Pelletier <subdino2004@yahoo.fr>.
This commit is contained in:
marco_g 2004-12-29 22:43:48 +00:00
parent 8514a1e003
commit 6b8fd1c428
2 changed files with 23 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2004-12-29 Marco Gerards <metgerards@student.han.nl>
* normal/cmdline.c (grub_cmdline_get): Redone logic so no empty
lines are inserted and make it work like readline. Reported by
Vincent Pelletier <subdino2004@yahoo.fr>.
2004-12-28 Marco Gerards <metgerards@student.han.nl>
* boot/powerpc/ieee1275/crt0.S (_start): Don't set up the stack.

View file

@ -556,6 +556,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
cl_insert (cmdline);
if (hist_used == 0)
grub_history_add (buf);
while ((key = GRUB_TERM_ASCII_CHAR (grub_getkey ())) != '\n' && key != '\r')
@ -641,7 +642,10 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
lpos = 0;
if (histpos > 0)
{
grub_history_replace (histpos, buf);
histpos--;
}
cl_delete (llen);
hist = grub_history_get (histpos);
@ -656,7 +660,10 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
lpos = 0;
if (histpos < hist_used - 1)
{
grub_history_replace (histpos, buf);
histpos++;
}
cl_delete (llen);
hist = grub_history_get (histpos);
@ -723,8 +730,6 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
}
break;
}
grub_history_replace (histpos, buf);
}
grub_putchar ('\n');
@ -736,6 +741,13 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
while (buf[lpos] == ' ')
lpos++;
histpos = 0;
if (grub_strlen (buf) > 0)
{
grub_history_replace (histpos, buf);
grub_history_add ("");
}
grub_memcpy (cmdline, buf + lpos, llen - lpos + 1);
return 1;