merge mainline into legacy_parser
This commit is contained in:
commit
0cb2f2813f
124 changed files with 3369 additions and 1991 deletions
|
@ -160,14 +160,23 @@ iterate_dev (const char *devname)
|
|||
|
||||
if (dev)
|
||||
{
|
||||
if (dev->disk && dev->disk->has_partitions)
|
||||
char tmp[grub_strlen (devname) + sizeof (",")];
|
||||
|
||||
grub_memcpy (tmp, devname, grub_strlen (devname));
|
||||
|
||||
if (grub_strcmp (devname, current_word) == 0)
|
||||
{
|
||||
if (add_completion (devname, ",", GRUB_COMPLETION_TYPE_DEVICE))
|
||||
if (add_completion (devname, ")", GRUB_COMPLETION_TYPE_PARTITION))
|
||||
return 1;
|
||||
|
||||
if (dev->disk)
|
||||
if (grub_partition_iterate (dev->disk, iterate_partition))
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (add_completion (devname, ")", GRUB_COMPLETION_TYPE_DEVICE))
|
||||
grub_memcpy (tmp + grub_strlen (devname), "", sizeof (""));
|
||||
if (add_completion (tmp, "", GRUB_COMPLETION_TYPE_DEVICE))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -200,7 +209,7 @@ complete_device (void)
|
|||
|
||||
if (dev)
|
||||
{
|
||||
if (dev->disk && dev->disk->has_partitions)
|
||||
if (dev->disk)
|
||||
{
|
||||
if (grub_partition_iterate (dev->disk, iterate_partition))
|
||||
{
|
||||
|
@ -247,7 +256,8 @@ complete_file (void)
|
|||
goto fail;
|
||||
}
|
||||
|
||||
dir = grub_strchr (current_word, '/');
|
||||
dir = grub_strchr (current_word + (device ? 2 + grub_strlen (device) : 0),
|
||||
'/');
|
||||
last_dir = grub_strrchr (current_word, '/');
|
||||
if (dir)
|
||||
{
|
||||
|
@ -419,11 +429,8 @@ grub_normal_do_completion (char *buf, int *restore,
|
|||
{
|
||||
if (cmd->prio & GRUB_PRIO_LIST_FLAG_ACTIVE)
|
||||
{
|
||||
if (cmd->flags & GRUB_COMMAND_FLAG_CMDLINE)
|
||||
{
|
||||
if (add_completion (cmd->name, " ", GRUB_COMPLETION_TYPE_COMMAND))
|
||||
goto fail;
|
||||
}
|
||||
if (add_completion (cmd->name, " ", GRUB_COMPLETION_TYPE_COMMAND))
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -155,7 +155,6 @@ read_command_list (const char *prefix)
|
|||
grub_dyncmd_dispatcher,
|
||||
GRUB_COMMAND_FLAG_BLOCKS
|
||||
| GRUB_COMMAND_FLAG_EXTCMD
|
||||
| GRUB_COMMAND_FLAG_CMDLINE
|
||||
| GRUB_COMMAND_FLAG_DYNCMD,
|
||||
0, N_("not loaded"), 0,
|
||||
prio);
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <grub/datetime.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/partition.h>
|
||||
|
||||
/* Print the information on the device NAME. */
|
||||
grub_err_t
|
||||
|
@ -107,10 +108,18 @@ grub_normal_print_device_info (const char *name)
|
|||
grub_errno = GRUB_ERR_NONE;
|
||||
}
|
||||
}
|
||||
else if (! dev->disk->has_partitions || dev->disk->partition)
|
||||
grub_printf ("%s", _("Unknown filesystem"));
|
||||
else
|
||||
grub_printf ("%s", _("Partition table"));
|
||||
grub_printf ("%s", _("Not a known filesystem"));
|
||||
|
||||
if (dev->disk->partition)
|
||||
grub_printf (_(" - Partition start at %u"),
|
||||
grub_partition_get_start (dev->disk->partition));
|
||||
if (grub_disk_get_size (dev->disk) == GRUB_DISK_SIZE_UNKNOWN)
|
||||
grub_printf (_(" - Total size unknown"),
|
||||
grub_disk_get_size (dev->disk));
|
||||
else
|
||||
grub_printf (_(" - Total size %u sectors"),
|
||||
grub_disk_get_size (dev->disk));
|
||||
|
||||
grub_device_close (dev);
|
||||
}
|
||||
|
|
|
@ -657,7 +657,7 @@ put_glyphs_terminal (const struct grub_unicode_glyph *visual,
|
|||
>= (grub_ssize_t) grub_term_height (term) - 2)
|
||||
{
|
||||
state->backlog_glyphs = visual_ptr + 1;
|
||||
state->backlog_len = visual_len - (visual - visual_ptr) - 1;
|
||||
state->backlog_len = visual_len - (visual_ptr - visual) - 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -688,6 +688,7 @@ print_backlog (struct grub_term_output *term,
|
|||
grub_free (state->free);
|
||||
state->free = NULL;
|
||||
state->backlog_len = 0;
|
||||
state->backlog_ucs4 = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -703,6 +704,7 @@ print_backlog (struct grub_term_output *term,
|
|||
grub_free (state->free);
|
||||
state->free = NULL;
|
||||
state->backlog_len = 0;
|
||||
state->backlog_glyphs = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue