Display the path of the file when file is not found
* grub-core/fs/fat.c: Display the filename when file is not found. * grub-core/fs/fshelp.c: Likewise. * grub-core/fs/hfs.c: Likewise. * grub-core/fs/jfs.c: Likewise. * grub-core/fs/minix.c: Likewise. * grub-core/fs/ufs.c: Likewise. * grub-core/fs/btrfs.c: Likewise. * grub-core/commands/i386/pc/play.c: Likewise.
This commit is contained in:
parent
cbf597afb1
commit
9e322ce8de
9 changed files with 57 additions and 13 deletions
|
@ -565,6 +565,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
|
|||
const struct grub_dirhook_info *info))
|
||||
{
|
||||
char *dirname, *dirp;
|
||||
char *origpath = NULL;
|
||||
int call_hook;
|
||||
int found = 0;
|
||||
|
||||
|
@ -605,6 +606,10 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
|
|||
return 0;
|
||||
}
|
||||
|
||||
origpath = grub_strdup (path);
|
||||
if (!origpath)
|
||||
return 0;
|
||||
|
||||
/* Extract a directory name. */
|
||||
while (*path == '/')
|
||||
path++;
|
||||
|
@ -616,7 +621,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
|
|||
|
||||
dirname = grub_malloc (len + 1);
|
||||
if (! dirname)
|
||||
return 0;
|
||||
goto fail;
|
||||
|
||||
grub_memcpy (dirname, path, len);
|
||||
dirname[len] = '\0';
|
||||
|
@ -629,9 +634,11 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
|
|||
|
||||
grub_fat_iterate_dir (disk, data, iter_hook);
|
||||
if (grub_errno == GRUB_ERR_NONE && ! found && !call_hook)
|
||||
grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
|
||||
grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
|
||||
|
||||
fail:
|
||||
grub_free (dirname);
|
||||
grub_free (origpath);
|
||||
|
||||
return found ? dirp : 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue