Hi,

I find  a problem related to the get_vfatname function. This is my
proposal patch.

Regards Michael


Check if the entry is a valid dir_slot entry, otherwise it is a dentry and the
name has to be taken by the get_name function

Signed-off-by: michael trimarchi <[EMAIL PROTECTED]>

---
 fs/fat/fat.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 49c78ed..ddee823 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -470,6 +470,12 @@ get_vfatname(fsdata *mydata, int curclust, __u8 *cluster,
 			return -1;
 		}
 		slotptr2 = (dir_slot*) get_vfatname_block;
+		if (slotptr2->attr != ATTR_VFAT) {
+			realdent = (dir_entry *)get_vfatname_block;
+			get_name ((dir_entry *)get_vfatname_block, l_name);
+			goto out;
+		}
+
 		while (slotptr2->id > 0x01) {
 			slotptr2++;
 		}
@@ -494,6 +500,7 @@ get_vfatname(fsdata *mydata, int curclust, __u8 *cluster,
 	else if (*l_name == aRING) *l_name = 'å';
 	downcase(l_name);
 
+out:
 	/* Return the real directory entry */
 	memcpy(retdent, realdent, sizeof(dir_entry));
 
-- 
1.5.2.1.174.gcd03-dirty


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to