From eb079ba9e22faa18c785df79d1ffb6050b5e76fd Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 28 Sep 2008 14:19:00 +0000 Subject: [PATCH] 008-09-28 Felix Zielcke fs/jfs.c (grub_jfs_find_file): Treat multiple slashes like one. Based on code from Tomas Ebenlendr . --- ChangeLog | 5 +++++ fs/jfs.c | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9a38983e..351934fa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +008-09-28 Felix Zielcke + + fs/jfs.c (grub_jfs_find_file): Treat multiple slashes like one. + Based on code from Tomas Ebenlendr . + 2008-09-28 Bean * fs/ntfs.c (grub_ntfs_iterate_dir): Fix a bug in the previous patch. diff --git a/fs/jfs.c b/fs/jfs.c index 8a027aec8..a4907ff55 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -614,8 +614,8 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path) if (grub_jfs_read_inode (data, GRUB_JFS_AGGR_INODE, &data->currinode)) return grub_errno; - /* Skip the first slash. */ - if (name[0] == '/') + /* Skip the first slashes. */ + while (*name == '/') { name++; if (!*name) @@ -626,10 +626,12 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path) next = grub_strchr (name, '/'); if (next) { - next[0] = '\0'; - next++; + while (*next == '/') + { + next[0] = '\0'; + next++; + } } - diro = grub_jfs_opendir (data, &data->currinode); if (!diro) return grub_errno;