Bugfix for certain FAT32 files

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1253 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Blair Campbell 2006-07-25 02:33:01 +00:00
parent 6b71193deb
commit 0b892e8479

View File

@ -274,7 +274,7 @@ CLUSTER link_fat(struct dpb FAR * dpbp, CLUSTER Cluster1,
{ {
/* form an index so that we can read the block as a */ /* form an index so that we can read the block as a */
/* byte array */ /* byte array */
UDWORD res = fgetlong(&bp->b_buffer[idx * 4]); UDWORD res = fgetlong(&bp->b_buffer[idx * 4]) & LONG_LAST_CLUSTER;
if (Cluster2 == READ_CLUSTER) if (Cluster2 == READ_CLUSTER)
{ {
if (res > LONG_BAD) if (res > LONG_BAD)
@ -284,7 +284,7 @@ CLUSTER link_fat(struct dpb FAR * dpbp, CLUSTER Cluster1,
} }
/* Finally, put the word into the buffer and mark the */ /* Finally, put the word into the buffer and mark the */
/* buffer as dirty. */ /* buffer as dirty. */
fputlong(&bp->b_buffer[idx * 4], Cluster2); fputlong(&bp->b_buffer[idx * 4], Cluster2 & LONG_LAST_CLUSTER);
if (res == FREE) if (res == FREE)
wasfree++; wasfree++;
} }