Fix a bug in icondir handling
This commit is contained in:
parent
aff798d6f4
commit
87efa251d5
1 changed files with 11 additions and 4 deletions
|
@ -137,14 +137,21 @@ static struct grub_video_bitmap *
|
|||
try_loading_icon (grub_gfxmenu_icon_manager_t mgr,
|
||||
const char *dir, const char *class_name)
|
||||
{
|
||||
char *path = grub_malloc (grub_strlen (dir)
|
||||
+ grub_strlen (class_name)
|
||||
+ grub_strlen (icon_extension)
|
||||
+ 1);
|
||||
char *path;
|
||||
int l;
|
||||
|
||||
path = grub_malloc (grub_strlen (dir) + grub_strlen (class_name)
|
||||
+ grub_strlen (icon_extension) + 3);
|
||||
if (! path)
|
||||
return 0;
|
||||
|
||||
grub_strcpy (path, dir);
|
||||
l = grub_strlen (path);
|
||||
if (path[l-1] != '/')
|
||||
{
|
||||
path[l] = '/';
|
||||
path[l+1] = 0;
|
||||
}
|
||||
grub_strcat (path, class_name);
|
||||
grub_strcat (path, icon_extension);
|
||||
|
||||
|
|
Loading…
Reference in a new issue