* grub-core/kern/corecmd.c (grub_core_cmd_ls): Fix empty path

checking.
	Reported by: Francesco Lavra.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-05-15 10:11:25 +02:00
parent 17806392f1
commit 1359e4740a
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2013-05-15 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/corecmd.c (grub_core_cmd_ls): Fix empty path
checking.
Reported by: Francesco Lavra.
2013-05-14 Andrey Borzenkov <arvidjaar@gmail.com>
* gentpl.py: Replace EXTRA_DIST with dist_noinst_DATA or

View file

@ -134,18 +134,18 @@ grub_core_cmd_ls (struct grub_command *cmd __attribute__ ((unused)),
fs = grub_fs_probe (dev);
path = grub_strchr (argv[0], ')');
if (! path)
if (! *path)
path = argv[0];
else
path++;
if (! path && ! device_name)
if (! *path && ! device_name)
{
grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument");
goto fail;
}
if (! path)
if (! *path)
{
if (grub_errno == GRUB_ERR_UNKNOWN_FS)
grub_errno = GRUB_ERR_NONE;