kern/partition: Unbreak support for nested partitions

When using syntax "hd0,gtp3,dfly1" then ptr points to trailing part, ",dfly1".
So, it's improper to consider it as an invalid partition.

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Vladimir Serbinenko 2025-03-03 00:02:21 +03:00 committed by Daniel Kiper
parent cb639acea0
commit ee27f07a65

View File

@ -134,7 +134,7 @@ grub_partition_probe (struct grub_disk *disk, const char *str)
partname_end = ptr;
num = grub_strtoul (ptr, &ptr, 0);
if (*ptr != '\0' || num == 0 || num > GRUB_INT_MAX)
if (num == 0 || num > GRUB_INT_MAX)
{
grub_error (GRUB_ERR_BAD_NUMBER, N_("invalid partition number"));
return 0;