From 82b00364a8ad2d5c3e205f24c76a8786ff8fa500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Tue, 5 Jul 2011 12:17:11 +0200 Subject: [PATCH] Fixed setting DOS names when defined with lower-case chars --- libntfs-3g/unistr.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libntfs-3g/unistr.c b/libntfs-3g/unistr.c index ffaabe02..06095097 100644 --- a/libntfs-3g/unistr.c +++ b/libntfs-3g/unistr.c @@ -1406,16 +1406,18 @@ BOOL ntfs_collapsible_chars(ntfs_volume *vol, { BOOL collapsible; unsigned int ch; + unsigned int cs; int i; collapsible = shortlen == longlen; - if (collapsible) - for (i=0; i= vol->upcase_len) - || ((shortname[i] != longname[i]) - && (shortname[i] != vol->upcase[ch]))) - collapsible = FALSE; + for (i=0; collapsible && (i= vol->upcase_len) + || (cs >= vol->upcase_len) + || (vol->upcase[cs] != vol->upcase[ch]))) + collapsible = FALSE; } return (collapsible); }