Browse Source

Make use internal str*casecmp/wcscoll

Peter S. Mazinger 18 years ago
parent
commit
92a148d641
5 changed files with 9 additions and 13 deletions
  1. 1 1
      libc/inet/resolv.c
  2. 3 10
      libc/inet/rpc/ruserpass.c
  3. 2 0
      libc/misc/regex/regex.c
  4. 1 0
      libc/misc/regex/regex_old.c
  5. 2 2
      libc/misc/wchar/wchar.c

+ 1 - 1
libc/inet/resolv.c

@@ -1535,7 +1535,7 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type,
 		} else {
 			/* GET_HOSTS_BYNAME */
 			for (i = 1; i < aliases; i++)
-				if (strcasecmp(name, alias[i]) == 0)
+				if (__strcasecmp(name, alias[i]) == 0)
 					break;
 			if (i >= aliases)
 				continue;

+ 3 - 10
libc/inet/rpc/ruserpass.c

@@ -149,18 +149,11 @@ next:
 			 * or official hostname.  Also allow match of
 			 * incompletely-specified host in local domain.
 			 */
-			if (strcasecmp(host, tokval) == 0)
+			if (__strcasecmp(host, tokval) == 0)
 				goto match;
-/*			if (__strcasecmp(hostname, tokval) == 0)
-				goto match;
-			if ((tmp = __strchr(hostname, '.')) != NULL &&
-			    __strcasecmp(tmp, mydomain) == 0 &&
-			    __strncasecmp(hostname, tokval, tmp-hostname) == 0 &&
-			    tokval[tmp - hostname] == '\0')
-				goto match; */
 			if ((tmp = __strchr(host, '.')) != NULL &&
-			    strcasecmp(tmp, mydomain) == 0 &&
-			    strncasecmp(host, tokval, tmp - host) == 0 &&
+			    __strcasecmp(tmp, mydomain) == 0 &&
+			    __strncasecmp(host, tokval, tmp - host) == 0 &&
 			    tokval[tmp - host] == '\0')
 				goto match;
 			continue;

+ 2 - 0
libc/misc/regex/regex.c

@@ -54,6 +54,8 @@ extern int __iswctype (wint_t __wc, wctype_t __desc) /*attribute_hidden*/;
 #define strlen __strlen
 #define strncpy __strncpy
 #define getenv __getenv
+#define strcasecmp __strcasecmp
+#define wcscoll __wcscoll
 
 extern void *__mempcpy (void *__restrict __dest,
 			__const void *__restrict __src, size_t __n) /*attribute_hidden*/;

+ 1 - 0
libc/misc/regex/regex_old.c

@@ -28,6 +28,7 @@
 #define wcslen __wcslen
 /* for some reason this does not work */
 #define memcpy __memcpy
+#define wcscoll __wcscoll
 
 /* To exclude some unwanted junk.... */
 #undef _LIBC

+ 2 - 2
libc/misc/wchar/wchar.c

@@ -1267,7 +1267,7 @@ static int find_codeset(const char *name)
 	int codeset;
 
 	for (s = __iconv_codesets ; *s ; s += *s) {
-		if (!strcasecmp(s+2, name)) {
+		if (!__strcasecmp(s+2, name)) {
 			return s[1];
 		}
 	}
@@ -1280,7 +1280,7 @@ static int find_codeset(const char *name)
 	s = __LOCALE_DATA_CODESET_LIST;
 	do {
 		++codeset;		/* Increment codeset first. */
-		if (!strcasecmp(__LOCALE_DATA_CODESET_LIST+*s, name)) {
+		if (!__strcasecmp(__LOCALE_DATA_CODESET_LIST+*s, name)) {
 			return codeset;
 		}
 	} while (*++s);