* util/grub-probe.c (probe): Don't crash on canonicalize_file_name
failure. Put back lost PRINT_DRIVE.
This commit is contained in:
parent
e9084abefd
commit
65f08dbfe0
3 changed files with 19 additions and 4 deletions
|
@ -323,6 +323,8 @@ probe (const char *path, char **device_names, char delim)
|
|||
if (path != NULL)
|
||||
{
|
||||
grub_path = canonicalize_file_name (path);
|
||||
if (! grub_path)
|
||||
grub_util_error (_("failed to get canonical path of %s"), path);
|
||||
device_names = grub_guess_root_devices (grub_path);
|
||||
free (grub_path);
|
||||
}
|
||||
|
@ -358,6 +360,16 @@ probe (const char *path, char **device_names, char delim)
|
|||
}
|
||||
*curdrive = 0;
|
||||
|
||||
if (print == PRINT_DRIVE)
|
||||
{
|
||||
for (curdrive = drives_names; *curdrive; curdrive++)
|
||||
{
|
||||
printf ("(%s)", *curdrive);
|
||||
putchar (delim);
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (print == PRINT_FS || print == PRINT_FS_UUID
|
||||
|| print == PRINT_FS_LABEL)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue