From e1ea3ade95471d5aee05fb698b58c836b30f61ef Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 9 Feb 2012 14:27:05 +0100 Subject: [PATCH] * grub-core/fs/cpio.c (grub_cpio_dir): Fix a bug with multiple listing. Explicitly init restart while on it. --- ChangeLog | 5 +++++ grub-core/fs/cpio.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1e3176e63..ec7b556d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-02-09 Vladimir Serbinenko + + * grub-core/fs/cpio.c (grub_cpio_dir): Fix a bug with multiple listing. + Explicitly init restart while on it. + 2012-02-09 Vladimir Serbinenko * grub-core/lib/posix_wrap/wchar.h (mbrtowc): Set pwc to zero to avoid diff --git a/grub-core/fs/cpio.c b/grub-core/fs/cpio.c index bfaf14101..1065df94a 100644 --- a/grub-core/fs/cpio.c +++ b/grub-core/fs/cpio.c @@ -539,7 +539,7 @@ grub_cpio_dir (grub_device_t device, const char *path_in, if (p) *p = 0; - if (((!prev) || (grub_strcmp (prev, n) != 0)) && *n != 0) + if (((!prev) || (grub_strcmp (prev, name) != 0)) && *n != 0) { struct grub_dirhook_info info; grub_memset (&info, 0, sizeof (info)); @@ -554,7 +554,7 @@ grub_cpio_dir (grub_device_t device, const char *path_in, } else { - int restart; + int restart = 0; err = handle_symlink (data, name, &path, mode, &restart); grub_free (name); if (err)