+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.
cl_insert (cmdline);
- grub_history_add (buf);
+ if (hist_used == 0)
+ grub_history_add (buf);
while ((key = GRUB_TERM_ASCII_CHAR (grub_getkey ())) != '\n' && key != '\r')
{
lpos = 0;
if (histpos > 0)
- histpos--;
+ {
+ grub_history_replace (histpos, buf);
+ histpos--;
+ }
cl_delete (llen);
hist = grub_history_get (histpos);
lpos = 0;
if (histpos < hist_used - 1)
- histpos++;
+ {
+ grub_history_replace (histpos, buf);
+ histpos++;
+ }
cl_delete (llen);
hist = grub_history_get (histpos);
}
break;
}
-
- grub_history_replace (histpos, buf);
}
grub_putchar ('\n');
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;