From 9e67c4f766892f7c0b79a2d6a1d8b96a7e4b7100 Mon Sep 17 00:00:00 2001 From: Asanka Herath Date: Mon, 12 May 2008 02:36:36 +0000 Subject: [PATCH] windows-unicode-support-normalize-20080511 LICENSE MIT Actually normalize when normaliz.dll is present. --- src/WINNT/afsd/cm_utils.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/WINNT/afsd/cm_utils.c b/src/WINNT/afsd/cm_utils.c index fc1d8fb54..d9cefeb40 100644 --- a/src/WINNT/afsd/cm_utils.c +++ b/src/WINNT/afsd/cm_utils.c @@ -429,7 +429,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 * @@ -438,6 +438,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; @@ -507,16 +517,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; - } } } -- 2.39.5