Changes by: antona
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20763/libntfs
Modified Files:
bitmap.c
Log Message:
Fix stupid bug in libntfs/bitmap.c::ntfs_bitmap_set_bits_in_run()
which caused bits to not be cleared or set if the first bit in the
run was not a multiple of eight. (Anton)
Index: bitmap.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/bitmap.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- bitmap.c 2 Nov 2005 17:34:08 -0000 1.18
+++ bitmap.c 2 Feb 2006 13:57:00 -0000 1.19
@@ -162,7 +162,14 @@ static __inline__ int ntfs_bitmap_set_bi
/* Update counters. */
tmp = (bufsize - firstbyte - lastbyte) << 3;
- firstbyte = 0;
+ if (firstbyte) {
+ firstbyte = 0;
+ /*
+ * Re-set the partial first byte so a subsequent write
+ * of the buffer does not have stale, incorrect bits.
+ */
+ *buf = value ? 0xff : 0;
+ }
start_bit += tmp;
count -= tmp;
if (bufsize > (tmp = (count + 7) >> 3))
|