2010-01-27 Vladimir Serbinenko <phcoder@gmail.com>

* normal/cmdline.c (grub_cmdline_get): Fix completion in the middle
	of the line.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-01-27 17:47:36 +01:00
parent 989e1f934b
commit 63533ab093
2 changed files with 21 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2010-01-27 Vladimir Serbinenko <phcoder@gmail.com>
* normal/cmdline.c (grub_cmdline_get): Fix completion in the middle
of the line.
2010-01-27 Vladimir Serbinenko <phcoder@gmail.com>
* kern/disk.c (grub_disk_read): Fix offset computation when reading

View file

@ -419,10 +419,13 @@ grub_cmdline_get (const char *prompt)
int restore;
char *insertu8;
char *bufu8;
grub_uint32_t c;
c = buf[lpos];
buf[lpos] = '\0';
bufu8 = grub_ucs4_to_utf8_alloc (buf, lpos);
buf[lpos] = c;
if (!bufu8)
{
grub_print_error ();
@ -462,8 +465,19 @@ grub_cmdline_get (const char *prompt)
insertlen, 0);
if (t > 0)
{
insert[t] = 0;
cl_insert (insert);
if (insert[t-1] == ' ' && buf[lpos] == ' ')
{
insert[t-1] = 0;
if (t != 1)
cl_insert (insert);
lpos++;
cl_set_pos_all ();
}
else
{
insert[t] = 0;
cl_insert (insert);
}
}
grub_free (insertu8);