Avoid locale specific ctype routines.

This commit is contained in:
Kurt Zeilenga 2000-06-29 19:38:03 +00:00
parent aa4a44263d
commit 49d73e12a7
17 changed files with 15 additions and 32 deletions

View file

@ -16,7 +16,6 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/socket.h> #include <ac/socket.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>

View file

@ -24,7 +24,6 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>
#include <ac/unistd.h> #include <ac/unistd.h>

View file

@ -9,7 +9,6 @@
#include <stdio.h> #include <stdio.h>
#include <ac/ctype.h>
#include <ac/socket.h> #include <ac/socket.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>

View file

@ -25,7 +25,6 @@
#include <stdio.h> #include <stdio.h>
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>
@ -155,7 +154,7 @@ next_token( char **sp )
p = *sp; p = *sp;
while ( isspace( (unsigned char) *p )) { /* skip leading white space */ while ( LDAP_SPACE( (unsigned char) *p )) { /* skip leading white space */
++p; ++p;
} }
@ -170,7 +169,7 @@ next_token( char **sp )
t = tokstart = p; t = tokstart = p;
for ( ;; ) { for ( ;; ) {
if ( *p == '\0' || ( isspace( (unsigned char) *p ) && !in_quote )) { if ( *p == '\0' || ( LDAP_SPACE( (unsigned char) *p ) && !in_quote )) {
if ( *p != '\0' ) { if ( *p != '\0' ) {
++p; ++p;
} }

View file

@ -16,7 +16,6 @@
#include <stdio.h> #include <stdio.h>
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>

View file

@ -15,7 +15,6 @@
#include <stdio.h> #include <stdio.h>
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/errno.h> #include <ac/errno.h>
#include <ac/socket.h> #include <ac/socket.h>
#include <ac/string.h> #include <ac/string.h>

View file

@ -15,7 +15,6 @@
#include <stdio.h> #include <stdio.h>
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/socket.h> #include <ac/socket.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>

View file

@ -15,7 +15,6 @@
#include <stdio.h> #include <stdio.h>
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/socket.h> #include <ac/socket.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>

View file

@ -16,7 +16,6 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/errno.h> #include <ac/errno.h>
#include <ac/regex.h> #include <ac/regex.h>
#include <ac/string.h> #include <ac/string.h>
@ -347,12 +346,12 @@ ldap_build_filter(
if ( *p == '%' ) { if ( *p == '%' ) {
++p; ++p;
if ( *p == 'v' ) { if ( *p == 'v' ) {
if ( isdigit( (unsigned char) p[1] )) { if ( LDAP_DIGIT( (unsigned char) p[1] )) {
++p; ++p;
wordnum = *p - '1'; wordnum = *p - '1';
if ( *(p+1) == '-' ) { if ( *(p+1) == '-' ) {
++p; ++p;
if ( isdigit( (unsigned char) p[1] )) { if ( LDAP_DIGIT( (unsigned char) p[1] )) {
++p; ++p;
endwordnum = *p - '1'; /* e.g., "%v2-4" */ endwordnum = *p - '1'; /* e.g., "%v2-4" */
if ( endwordnum > wordcount - 1 ) { if ( endwordnum > wordcount - 1 ) {

View file

@ -13,7 +13,6 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/socket.h> #include <ac/socket.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>

View file

@ -13,7 +13,6 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/socket.h> #include <ac/socket.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>

View file

@ -13,7 +13,6 @@
#include <stdio.h> #include <stdio.h>
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>
@ -131,7 +130,7 @@ append_to_safe_string(safe_string * ss, char * s)
} }
strncpy(&ss->val[ss->pos], s, l); strncpy(&ss->val[ss->pos], s, l);
ss->pos += l; ss->pos += l;
if ( ss->pos > 0 && isspace(ss->val[ss->pos-1]) ) if ( ss->pos > 0 && LDAP_SPACE(ss->val[ss->pos-1]) )
ss->at_whsp = 1; ss->at_whsp = 1;
else else
ss->at_whsp = 0; ss->at_whsp = 0;
@ -637,7 +636,7 @@ get_token(const char ** sp, char ** token_val)
default: default:
kind = TK_BAREWORD; kind = TK_BAREWORD;
p = *sp; p = *sp;
while ( !isspace(**sp) && while ( !LDAP_SPACE(**sp) &&
**sp != '(' && **sp != '(' &&
**sp != ')' && **sp != ')' &&
**sp != '$' && **sp != '$' &&
@ -665,7 +664,7 @@ get_token(const char ** sp, char ** token_val)
static void static void
parse_whsp(const char **sp) parse_whsp(const char **sp)
{ {
while (isspace(**sp)) while (LDAP_SPACE(**sp))
(*sp)++; (*sp)++;
} }
@ -694,7 +693,7 @@ parse_numericoid(const char **sp, int *code, const int flags)
} }
/* Each iteration of this loop gets one decimal string */ /* Each iteration of this loop gets one decimal string */
while (**sp) { while (**sp) {
if ( !isdigit(**sp) ) { if ( !LDAP_DIGIT(**sp) ) {
/* /*
* Initial char is not a digit or char after dot is * Initial char is not a digit or char after dot is
* not a digit * not a digit
@ -703,7 +702,7 @@ parse_numericoid(const char **sp, int *code, const int flags)
return NULL; return NULL;
} }
(*sp)++; (*sp)++;
while ( isdigit(**sp) ) while ( LDAP_DIGIT(**sp) )
(*sp)++; (*sp)++;
if ( **sp != '.' ) if ( **sp != '.' )
break; break;
@ -838,7 +837,7 @@ parse_noidlen(const char **sp, int *code, int *len, int allow_quoted)
if ( **sp == '{' /*}*/ ) { if ( **sp == '{' /*}*/ ) {
(*sp)++; (*sp)++;
*len = atoi(*sp); *len = atoi(*sp);
while ( isdigit(**sp) ) while ( LDAP_DIGIT(**sp) )
(*sp)++; (*sp)++;
if ( **sp != /*{*/ '}' ) { if ( **sp != /*{*/ '}' ) {
*code = LDAP_SCHERR_UNEXPTOKEN; *code = LDAP_SCHERR_UNEXPTOKEN;

View file

@ -16,7 +16,6 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/socket.h> #include <ac/socket.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>
@ -578,7 +577,7 @@ put_filter( BerElement *ber, char *str )
parens++; parens++;
/* skip spaces */ /* skip spaces */
while( isspace( *str ) ) str++; while( LDAP_SPACE( *str ) ) str++;
switch ( *str ) { switch ( *str ) {
case '&': case '&':
@ -690,7 +689,7 @@ put_filter_list( BerElement *ber, char *str )
Debug( LDAP_DEBUG_TRACE, "put_filter_list \"%s\"\n", str, 0, 0 ); Debug( LDAP_DEBUG_TRACE, "put_filter_list \"%s\"\n", str, 0, 0 );
while ( *str ) { while ( *str ) {
while ( *str && isspace( (unsigned char) *str ) ) while ( *str && LDAP_SPACE( (unsigned char) *str ) )
str++; str++;
if ( *str == '\0' ) if ( *str == '\0' )
break; break;

View file

@ -23,7 +23,6 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>
#include <ac/ctype.h>
#include "ldap-int.h" #include "ldap-int.h"
@ -48,7 +47,7 @@ static int countKeys(char *keyString)
for (;;) for (;;)
{ {
while (isspace(*p)) /* Skip leading whitespace */ while (LDAP_SPACE(*p)) /* Skip leading whitespace */
p++; p++;
if (*p == '\0') /* End of string? */ if (*p == '\0') /* End of string? */
@ -56,7 +55,7 @@ static int countKeys(char *keyString)
count++; /* Found start of a key */ count++; /* Found start of a key */
while (!isspace(*p)) /* Skip till next space or end of string. */ while (!LDAP_SPACE(*p)) /* Skip till next space or end of string. */
if (*p++ == '\0') if (*p++ == '\0')
return count; return count;
} }
@ -92,7 +91,7 @@ static int readNextKey( char **pNextKey, LDAPSortKey **key)
int oidLen = 0; int oidLen = 0;
/* Skip leading white space. */ /* Skip leading white space. */
while (isspace(*p)) while (LDAP_SPACE(*p))
p++; p++;
if (*p == '-') /* Check if the reverse flag is present. */ if (*p == '-') /* Check if the reverse flag is present. */

View file

@ -16,7 +16,6 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/socket.h> #include <ac/socket.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>

View file

@ -28,7 +28,6 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/socket.h> #include <ac/socket.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>

View file

@ -22,7 +22,6 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>
#include <ac/ctype.h>
#include "ldap-int.h" #include "ldap-int.h"