Changes by: antona
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25289
Modified Files:
collate.c unistr.c
Log Message:
Some cleanups.
Index: collate.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/collate.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- collate.c 6 Jul 2005 22:47:17 -0000 1.7
+++ collate.c 22 Aug 2005 09:00:16 -0000 1.8
@@ -73,21 +73,14 @@ static int ntfs_collate_file_name(ntfs_v
const void *data2, const int data2_len __attribute__((unused)))
{
int rc;
- const FILE_NAME_ATTR *fn1, *fn2;
ntfs_debug("Entering.");
- fn1 = (const FILE_NAME_ATTR *)data1;
- fn2 = (const FILE_NAME_ATTR *)data2;
- rc = ntfs_names_collate(fn1->file_name, fn1->file_name_length,
- fn2->file_name, fn2->file_name_length,
- NTFS_COLLATION_ERROR, IGNORE_CASE, vol->upcase,
- vol->upcase_len);
- if (!rc) {
- rc = ntfs_names_collate(fn1->file_name, fn1->file_name_length,
- fn2->file_name, fn2->file_name_length,
+ rc = ntfs_file_values_compare(data1, data2, NTFS_COLLATION_ERROR,
+ IGNORE_CASE, vol->upcase, vol->upcase_len);
+ if (!rc)
+ rc = ntfs_file_values_compare(data1, data2,
NTFS_COLLATION_ERROR, CASE_SENSITIVE,
vol->upcase, vol->upcase_len);
- }
ntfs_debug("Done, returning %i.", rc);
return rc;
}
Index: unistr.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/unistr.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -p -r1.22 -r1.23
--- unistr.c 6 Aug 2005 12:37:30 -0000 1.22
+++ unistr.c 22 Aug 2005 09:00:16 -0000 1.23
@@ -88,12 +88,14 @@ BOOL ntfs_names_are_equal(const ntfschar
/**
* ntfs_names_collate - collate two Unicode names
- * @upcase: upcase table (ignored if @ic is CASE_SENSITIVE)
- * @upcase_len: upcase table size (ignored if @ic is CASE_SENSITIVE)
* @name1: first Unicode name to compare
+ * @name1_len: length of first Unicode name to compare
* @name2: second Unicode name to compare
- * @ic: either CASE_SENSITIVE or IGNORE_CASE
+ * @name2_len: length of second Unicode name to compare
* @err_val: if @name1 contains an invalid character return this value
+ * @ic: either CASE_SENSITIVE or IGNORE_CASE
+ * @upcase: upcase table (ignored if @ic is CASE_SENSITIVE)
+ * @upcase_len: upcase table size (ignored if @ic is CASE_SENSITIVE)
*
* ntfs_names_collate() collates two Unicode names and returns:
*
@@ -113,7 +115,7 @@ int ntfs_names_collate(const ntfschar *n
ntfschar c1, c2;
#ifdef DEBUG
- if (!name1 || !name2 || (ic && !upcase && upcase_len)) {
+ if (!name1 || !name2 || (ic && (!upcase || upcase_len))) {
Dputs("ntfs_names_collate received NULL pointer!");
exit(1);
}
|