summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-02-23 19:30:57 +0000
committerwdenk <wdenk>2004-02-23 19:30:57 +0000
commit2d1a537d87727907bf4d888760cba4abc0b52ad3 (patch)
tree29deb37d04cc84308f57ec4274bea7efad743536 /fs
parent3f85ce27858c44ee75d3650a53154ebcec0e24f2 (diff)
* Patch by Thomas Elste, 10 Feb 2004:
Add support for NET+50 CPU and ModNET50 board * Patch by Sam Song, 10 Feb 2004: Fix typos in cfi_flash.c * Patch by Leon Kukovec, 10 Feb 2004 Fixed long dir entry slot id calculation in get_vfatname * Patch by Robin Gilks, 10 Feb 2004: add "itest" command (operators: -eq, -ne, -lt, -gt, -le, -ge, ==, !=, <>, <, >, <=, >=)
Diffstat (limited to 'fs')
-rw-r--r--fs/fat/fat.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index f02c404a8bd..daa70349d27 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -432,12 +432,13 @@ get_vfatname(fsdata *mydata, int curclust, __u8 *cluster,
dir_entry *realdent;
dir_slot *slotptr = (dir_slot*) retdent;
__u8 *nextclust = cluster + mydata->clust_size * SECTOR_SIZE;
- __u8 counter = slotptr->id & 0xf;
+ __u8 counter = (slotptr->id & ~LAST_LONG_ENTRY_MASK) & 0xff;
int idx = 0;
while ((__u8*)slotptr < nextclust) {
if (counter == 0) break;
- if ((slotptr->id & 0x0f) != counter) return -1;
+ if (((slotptr->id & ~LAST_LONG_ENTRY_MASK) & 0xff) != counter)
+ return -1;
slotptr++;
counter--;
}
@@ -475,7 +476,7 @@ get_vfatname(fsdata *mydata, int curclust, __u8 *cluster,
do {
slotptr--;
if (slot2str(slotptr, l_name, &idx)) break;
- } while (!(slotptr->id & 0x40));
+ } while (!(slotptr->id & LAST_LONG_ENTRY_MASK));
l_name[idx] = '\0';
if (*l_name == DELETED_FLAG) *l_name = '\0';
@@ -536,7 +537,7 @@ static dir_entry *get_dentfromdir (fsdata * mydata, int startsect,
if ((dentptr->attr & ATTR_VOLUME)) {
#ifdef CONFIG_SUPPORT_VFAT
if ((dentptr->attr & ATTR_VFAT) &&
- (dentptr->name[0] & 0x40)) {
+ (dentptr->name[0] & LAST_LONG_ENTRY_MASK)) {
prevcksum = ((dir_slot *) dentptr)
->alias_checksum;
get_vfatname (mydata, curclust, get_dentfromdir_block,
@@ -799,7 +800,7 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize,
if ((dentptr->attr & ATTR_VOLUME)) {
#ifdef CONFIG_SUPPORT_VFAT
if ((dentptr->attr & ATTR_VFAT) &&
- (dentptr->name[0] & 0x40)) {
+ (dentptr->name[0] & LAST_LONG_ENTRY_MASK)) {
prevcksum = ((dir_slot *) dentptr)->alias_checksum;
get_vfatname (mydata, 0, do_fat_read_block, dentptr, l_name);
if (dols == LS_ROOT) {