]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-unicode-support-normalize-20080511
authorAsanka Herath <asanka@secure-endpoints.com>
Mon, 12 May 2008 02:37:56 +0000 (02:37 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 12 May 2008 02:37:56 +0000 (02:37 +0000)
LICENSE MIT

Actually normalize when normaliz.dll is present.

(cherry picked from commit 9e67c4f766892f7c0b79a2d6a1d8b96a7e4b7100)

src/WINNT/afsd/cm_utils.c

index 98a51436164aa5cf6b88edf72a482e9c4cb6e6b2..e0d300652b17fabb6e3ffb58edac5b9c957860ab 100644 (file)
@@ -431,7 +431,7 @@ long cm_InitNormalization(void)
 
    Returns a pointer to the buffer containing the normalized string or
    NULL if the call was unsuccessful.  If the returned destination
-   buffer is different fron the supplied buffer and non-NULL, it
+   buffer is different from the supplied buffer and non-NULL, it
    should be freed using free().
 */
 static wchar_t * 
@@ -440,6 +440,16 @@ NormalizeUtf16String(const wchar_t * src, int cch_src, wchar_t * ext_dest, int *
     if ((pIsNormalizedString && (*pIsNormalizedString)(AFS_NORM_FORM, src, cch_src)) ||
         (!pNormalizeString)) {
 
+        /* No need to or unable to normalize.  Just copy the string */
+        if (SUCCEEDED(StringCchCopyNW(ext_dest, *pcch_dest, src, cch_src))) {
+            *pcch_dest = cch_src;
+            return ext_dest;
+        } else {
+            *pcch_dest = 0;
+            return NULL;
+        }
+    } else {
+
         int rv;
         DWORD gle;
         int tries = 10;
@@ -509,16 +519,6 @@ NormalizeUtf16String(const wchar_t * src, int cch_src, wchar_t * ext_dest, int *
 
         *pcch_dest = 0;
         return NULL;
-    } else {
-
-        /* No need to or unable to normalize.  Just copy the string */
-        if (SUCCEEDED(StringCchCopyNW(ext_dest, *pcch_dest, src, cch_src))) {
-            *pcch_dest = cch_src;
-            return ext_dest;
-        } else {
-            *pcch_dest = 0;
-            return NULL;
-        }
     }
 }