Add a comment regarding strwicmp only being an ASCII string compare
authorGarming Sam <garming@catalyst.net.nz>
Wed, 19 Mar 2014 19:56:42 +0000 (08:56 +1300)
committerJeremy Allison <jra@samba.org>
Wed, 7 May 2014 17:49:17 +0000 (19:49 +0200)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/util_str_common.c

index 20682f9935549e9313d8551a32803fda66b2a8ff..0933e183c8063681127e3ce8a389b631b22ed3a7 100644 (file)
@@ -24,7 +24,7 @@
 #include "includes.h"
 
 /**
-Do a case-insensitive, whitespace-ignoring string compare.
+Do a case-insensitive, whitespace-ignoring ASCII string compare.
 **/
 _PUBLIC_ int strwicmp(const char *psz1, const char *psz2)
 {
@@ -43,6 +43,12 @@ _PUBLIC_ int strwicmp(const char *psz1, const char *psz2)
                        psz1++;
                while (isspace((int)*psz2))
                        psz2++;
+
+               /*
+                * This does not do a genuine multi-byte comparison,
+                * instead it just uses the fast-path for ASCII in
+                * these common routines
+                */
                if (toupper_m((unsigned char)*psz1) != toupper_m((unsigned char)*psz2)
                    || *psz1 == '\0'
                    || *psz2 == '\0')