Some cleanups.

edge.strict_endians
antona 2005-08-22 09:00:16 +00:00
parent 2ea4ad30ec
commit c7eaee5a0f
2 changed files with 11 additions and 16 deletions

View File

@ -73,21 +73,14 @@ static int ntfs_collate_file_name(ntfs_volume *vol,
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;
}

View File

@ -88,12 +88,14 @@ BOOL ntfs_names_are_equal(const ntfschar *s1, size_t s1_len,
/**
* ntfs_names_collate - collate two Unicode names
* @name1: first Unicode name to compare
* @name1_len: length of first Unicode name to compare
* @name2: second Unicode name to compare
* @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)
* @name1: first Unicode name to compare
* @name2: second Unicode name to compare
* @ic: either CASE_SENSITIVE or IGNORE_CASE
* @err_val: if @name1 contains an invalid character return this value
*
* ntfs_names_collate() collates two Unicode names and returns:
*
@ -113,7 +115,7 @@ int ntfs_names_collate(const ntfschar *name1, const u32 name1_len,
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);
}