handle directories correctly

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-12-02 00:11:14 +01:00
parent 1f60e35331
commit 9b4cb862f8

View file

@ -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",