]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2004-08-14 Marco Gerards <metgerards@student.han.nl>
authormarco_g <marco_g@localhost>
Fri, 13 Aug 2004 22:33:35 +0000 (22:33 +0000)
committermarco_g <marco_g@localhost>
Fri, 13 Aug 2004 22:33:35 +0000 (22:33 +0000)
* include/grub/arg.h (GRUB_ARG_OPTION_OPTIONAL): Surround macro
with parentheses.

* fs/ext2.c (FILETYPE_UNKNOWN): New macro.
(grub_ext2_dir): In case the directory entry type is unknown, read
it from the inode.

ChangeLog
fs/ext2.c
include/grub/arg.h

index 77940676ec2c835989b929c0d597647f8ff77c23..67513ce9bfd9890c2b5f11943f339d24ca0345b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-08-14  Marco Gerards  <metgerards@student.han.nl>
+
+       * include/grub/arg.h (GRUB_ARG_OPTION_OPTIONAL): Surround macro
+       with parentheses.
+
+       * fs/ext2.c (FILETYPE_UNKNOWN): New macro.
+       (grub_ext2_dir): In case the directory entry type is unknown, read
+       it from the inode.
+
 2004-08-02  Peter Bruin  <pjbruin@dds.nl>
 
        * loader/powerpc/ieee1275/linux.c (grub_linux_init): Pass
index 7c4cbd03dc13092483cc14a38cdb5b417fa56814..ed6e68caf0ee3ad4285f923b6ae42f75aa10e19e 100644 (file)
--- a/fs/ext2.c
+++ b/fs/ext2.c
@@ -28,6 +28,7 @@
 #define        EXT2_MAX_SYMLINKCNT     8
 
 /* Filetype used in directory entry.  */
+#define        FILETYPE_UNKNOWN        0
 #define        FILETYPE_DIRECTORY      2
 #define        FILETYPE_SYMLINK        7
 
@@ -688,7 +689,16 @@ grub_ext2_dir (grub_device_t device, const char *path,
          
          filename[dirent.namelen] = '\0';
          
-         hook (filename, dirent.filetype == FILETYPE_DIRECTORY);
+         if (dirent.filetype != FILETYPE_UNKNOWN)
+           hook (filename, dirent.filetype == FILETYPE_DIRECTORY);
+         else
+           {
+             struct grub_ext2_inode inode;
+             grub_ext2_read_inode (data, grub_le_to_cpu32 (dirent.inode), &inode);
+             
+             hook (filename, (grub_le_to_cpu16 (inode.mode)
+                              & FILETYPE_INO_MASK) == FILETYPE_INO_DIRECTORY);
+           }
        }
 
       fpos += grub_le_to_cpu16 (dirent.direntlen);
index d0817780752c4576b0fb5a5d733c2c52a10b6644..4bdad966dff2061b53c664fe5ca3fd29150b0274 100644 (file)
@@ -38,7 +38,7 @@ enum grub_arg_type
 typedef enum grub_arg_type grub_arg_type_t;
 
 /* Flags for the option field op grub_arg_option.  */
-#define GRUB_ARG_OPTION_OPTIONAL       1 << 1
+#define GRUB_ARG_OPTION_OPTIONAL       (1 << 1)
 
 enum grub_key_type
   {