svn commit: trunk/uClibc/libc/misc/fnmatch

psm at uclibc.org psm at uclibc.org
Mon Jan 30 22:48:03 UTC 2006


Author: psm
Date: 2006-01-30 14:48:02 -0800 (Mon, 30 Jan 2006)
New Revision: 13731

Log:
strlen is -cheaper- then strnlen

Modified:
   trunk/uClibc/libc/misc/fnmatch/fnmatch.c


Changeset:
Modified: trunk/uClibc/libc/misc/fnmatch/fnmatch.c
===================================================================
--- trunk/uClibc/libc/misc/fnmatch/fnmatch.c	2006-01-30 22:33:31 UTC (rev 13730)
+++ trunk/uClibc/libc/misc/fnmatch/fnmatch.c	2006-01-30 22:48:02 UTC (rev 13731)
@@ -95,7 +95,6 @@
 libc_hidden_proto(wcscoll)
 libc_hidden_proto(towlower)
 libc_hidden_proto(mbsrtowcs)
-libc_hidden_proto(strnlen)
 #  endif
 # endif
 #endif
@@ -373,17 +372,17 @@
 #  include "fnmatch_loop.c"
 # endif
 
-extern size_t _stdlib_mb_cur_max (void) __THROW __wur;
+#ifdef __UCLIBC_HAS_WCHAR__
 libc_hidden_proto(_stdlib_mb_cur_max)
+#else
+#undef MB_CUR_MAX
+#define MB_CUR_MAX 1
+#endif
 
 int
 fnmatch (const char *pattern, const char *string, int flags)
 {
 # if HANDLE_MULTIBYTE
-#  ifdef __UCLIBC_HAS_WCHAR__
-#   undef MB_CUR_MAX
-#   define	MB_CUR_MAX	(_stdlib_mb_cur_max ())
-#  endif
   if (__builtin_expect (MB_CUR_MAX, 1) != 1)
     {
       mbstate_t ps;
@@ -395,7 +394,7 @@
       /* Convert the strings into wide characters.  */
       __memset (&ps, '\0', sizeof (ps));
       p = pattern;
-#if defined _LIBC || defined __UCLIBC__
+#ifdef _LIBC
       n = strnlen (pattern, 1024);
 #else
       n = strlen (pattern);
@@ -426,7 +425,7 @@
 	}
 
       assert (mbsinit (&ps));
-#if defined _LIBC || defined __UCLIBC__
+#ifdef _LIBC
       n = strnlen (string, 1024);
 #else
       n = strlen (string);




More information about the uClibc-cvs mailing list