]> git.proxmox.com Git - grub2.git/commitdiff
008-09-28 Felix Zielcke <fzielcke@z-51.de>
authorfzielcke <fzielcke@localhost>
Sun, 28 Sep 2008 14:19:00 +0000 (14:19 +0000)
committerfzielcke <fzielcke@localhost>
Sun, 28 Sep 2008 14:19:00 +0000 (14:19 +0000)
fs/jfs.c (grub_jfs_find_file): Treat multiple slashes like one.
Based on code from Tomas Ebenlendr <ebik@ucw.cz>.

ChangeLog
fs/jfs.c

index c9a38983e553905e5efdc7abb5c7192499cfd72d..351934fa3971145494eddb2ed5375a77b772cf61 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+008-09-28  Felix Zielcke  <fzielcke@z-51.de>
+
+       fs/jfs.c (grub_jfs_find_file): Treat multiple slashes like one.
+       Based on code from Tomas Ebenlendr <ebik@ucw.cz>.
+
 2008-09-28  Bean  <bean123ch@gmail.com>
 
        * fs/ntfs.c (grub_ntfs_iterate_dir): Fix a bug in the previous patch.
index 8a027aec8f110302c4f31f0f05bd2d1e44ba47bc..a4907ff5582c65f68a96c0d19c413d60452e71dd 100644 (file)
--- 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;