From 9b4cb862f889a922c23f68f89403b0565d66bbdc Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 2 Dec 2010 00:11:14 +0100 Subject: [PATCH] handle directories correctly --- grub-core/fs/btrfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 6c6a6f9f8..1afd8fbb4 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -726,9 +726,11 @@ find_path (struct grub_btrfs_data *data, break; } case GRUB_BTRFS_ITEM_TYPE_INODE_ITEM: - if (*slash) + if (*slash && *type == GRUB_BTRFS_DIR_ITEM_TYPE_REGULAR) return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); *key = cdirel->key; + if (*type == GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY) + key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM; break; default: return grub_error (GRUB_ERR_BAD_FS, "unrecognised object type 0x%x",