Changes by: antona
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24969/ntfsprogs
Modified Files:
upcase.c
Log Message:
Fix upcase table to be little endian. With this bug fixed the volumes produced
by mkntfs on little and big endian machines are identical (except for the
volume serial number - probably ought to standardize that when using the -T
switch).
Index: upcase.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/upcase.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -r1.10 -r1.11
--- upcase.c 21 Oct 2005 18:05:14 -0000 1.10
+++ upcase.c 4 Feb 2006 06:06:04 -0000 1.11
@@ -2,9 +2,7 @@
* upcase - Part of the Linux-NTFS project.
*
* Copyright (c) 2001 Richard Russon
- * Copyright (c) 2001-2004 Anton Altaparmakov
- *
- * Modified for mkntfs inclusion 9 June 2001 by Anton Altaparmakov.
+ * Copyright (c) 2001-2006 Anton Altaparmakov
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -28,6 +26,7 @@
#include <string.h>
#endif
+#include "endians.h"
#include "types.h"
#include "upcase.h"
@@ -74,8 +73,9 @@ void init_upcase_table(ntfschar *uc, u32
};
int i, r;
- memset((char*)uc, 0, uc_len);
+ memset(uc, 0, uc_len);
uc_len >>= 1;
+ /* Generate the upcase table in cpu byte order. */
for (i = 0; (u32)i < uc_len; i++)
uc[i] = i;
for (r = 0; uc_run_table[r][0]; r++)
@@ -86,5 +86,7 @@ void init_upcase_table(ntfschar *uc, u32
uc[i + 1]--;
for (r = 0; uc_byte_table[r][0]; r++)
uc[uc_byte_table[r][0]] = uc_byte_table[r][1];
+ /* Convert the upcase table from cpu byte order to little endian. */
+ for (i = 0; (u32)i < uc_len; i++)
+ uc[i] = cpu_to_le16(uc[i]);
}
-
|