From 49d73e12a720cfe052a335d82e67994ff261d21c Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 29 Jun 2000 19:38:03 +0000 Subject: [PATCH] Avoid locale specific ctype routines. --- libraries/libldap/addentry.c | 1 - libraries/libldap/disptmpl.c | 1 - libraries/libldap/dn.c | 1 - libraries/libldap/dsparse.c | 5 ++--- libraries/libldap/free.c | 1 - libraries/libldap/friendly.c | 1 - libraries/libldap/getattr.c | 1 - libraries/libldap/getentry.c | 1 - libraries/libldap/getfilter.c | 5 ++--- libraries/libldap/messages.c | 1 - libraries/libldap/references.c | 1 - libraries/libldap/schema.c | 13 ++++++------- libraries/libldap/search.c | 5 ++--- libraries/libldap/sortctrl.c | 7 +++---- libraries/libldap/ufn.c | 1 - libraries/libldap/url.c | 1 - libraries/libldap/vlvctrl.c | 1 - 17 files changed, 15 insertions(+), 32 deletions(-) diff --git a/libraries/libldap/addentry.c b/libraries/libldap/addentry.c index 4ee6870222..3bf03ce2f8 100644 --- a/libraries/libldap/addentry.c +++ b/libraries/libldap/addentry.c @@ -16,7 +16,6 @@ #include -#include #include #include #include diff --git a/libraries/libldap/disptmpl.c b/libraries/libldap/disptmpl.c index 82dcfe8f3d..f1cf4117ce 100644 --- a/libraries/libldap/disptmpl.c +++ b/libraries/libldap/disptmpl.c @@ -24,7 +24,6 @@ #include -#include #include #include #include diff --git a/libraries/libldap/dn.c b/libraries/libldap/dn.c index d0ba92f886..f05166b58d 100644 --- a/libraries/libldap/dn.c +++ b/libraries/libldap/dn.c @@ -9,7 +9,6 @@ #include -#include #include #include #include diff --git a/libraries/libldap/dsparse.c b/libraries/libldap/dsparse.c index 8ec7116fd9..57d80a541c 100644 --- a/libraries/libldap/dsparse.c +++ b/libraries/libldap/dsparse.c @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -155,7 +154,7 @@ next_token( char **sp ) p = *sp; - while ( isspace( (unsigned char) *p )) { /* skip leading white space */ + while ( LDAP_SPACE( (unsigned char) *p )) { /* skip leading white space */ ++p; } @@ -170,7 +169,7 @@ next_token( char **sp ) t = tokstart = p; for ( ;; ) { - if ( *p == '\0' || ( isspace( (unsigned char) *p ) && !in_quote )) { + if ( *p == '\0' || ( LDAP_SPACE( (unsigned char) *p ) && !in_quote )) { if ( *p != '\0' ) { ++p; } diff --git a/libraries/libldap/free.c b/libraries/libldap/free.c index e20ffbd24d..8d871ef241 100644 --- a/libraries/libldap/free.c +++ b/libraries/libldap/free.c @@ -16,7 +16,6 @@ #include #include -#include #include #include diff --git a/libraries/libldap/friendly.c b/libraries/libldap/friendly.c index 3078fee693..5d4abdabbe 100644 --- a/libraries/libldap/friendly.c +++ b/libraries/libldap/friendly.c @@ -15,7 +15,6 @@ #include #include -#include #include #include #include diff --git a/libraries/libldap/getattr.c b/libraries/libldap/getattr.c index 9a511ee2ea..79fe0a4ad0 100644 --- a/libraries/libldap/getattr.c +++ b/libraries/libldap/getattr.c @@ -15,7 +15,6 @@ #include #include -#include #include #include #include diff --git a/libraries/libldap/getentry.c b/libraries/libldap/getentry.c index dee482cfec..ccdca5ea40 100644 --- a/libraries/libldap/getentry.c +++ b/libraries/libldap/getentry.c @@ -15,7 +15,6 @@ #include #include -#include #include #include #include diff --git a/libraries/libldap/getfilter.c b/libraries/libldap/getfilter.c index 2d8b89c8a8..c837631e6d 100644 --- a/libraries/libldap/getfilter.c +++ b/libraries/libldap/getfilter.c @@ -16,7 +16,6 @@ #include -#include #include #include #include @@ -347,12 +346,12 @@ ldap_build_filter( if ( *p == '%' ) { ++p; if ( *p == 'v' ) { - if ( isdigit( (unsigned char) p[1] )) { + if ( LDAP_DIGIT( (unsigned char) p[1] )) { ++p; wordnum = *p - '1'; if ( *(p+1) == '-' ) { ++p; - if ( isdigit( (unsigned char) p[1] )) { + if ( LDAP_DIGIT( (unsigned char) p[1] )) { ++p; endwordnum = *p - '1'; /* e.g., "%v2-4" */ if ( endwordnum > wordcount - 1 ) { diff --git a/libraries/libldap/messages.c b/libraries/libldap/messages.c index 57cd4dbd43..f829ca7e14 100644 --- a/libraries/libldap/messages.c +++ b/libraries/libldap/messages.c @@ -13,7 +13,6 @@ #include -#include #include #include #include diff --git a/libraries/libldap/references.c b/libraries/libldap/references.c index c42f652057..9336aa9417 100644 --- a/libraries/libldap/references.c +++ b/libraries/libldap/references.c @@ -13,7 +13,6 @@ #include -#include #include #include #include diff --git a/libraries/libldap/schema.c b/libraries/libldap/schema.c index cae5dfc660..a8f85951ba 100644 --- a/libraries/libldap/schema.c +++ b/libraries/libldap/schema.c @@ -13,7 +13,6 @@ #include #include -#include #include #include @@ -131,7 +130,7 @@ append_to_safe_string(safe_string * ss, char * s) } strncpy(&ss->val[ss->pos], s, 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; else ss->at_whsp = 0; @@ -637,7 +636,7 @@ get_token(const char ** sp, char ** token_val) default: kind = TK_BAREWORD; p = *sp; - while ( !isspace(**sp) && + while ( !LDAP_SPACE(**sp) && **sp != '(' && **sp != ')' && **sp != '$' && @@ -665,7 +664,7 @@ get_token(const char ** sp, char ** token_val) static void parse_whsp(const char **sp) { - while (isspace(**sp)) + while (LDAP_SPACE(**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 */ while (**sp) { - if ( !isdigit(**sp) ) { + if ( !LDAP_DIGIT(**sp) ) { /* * Initial char is not a digit or char after dot is * not a digit @@ -703,7 +702,7 @@ parse_numericoid(const char **sp, int *code, const int flags) return NULL; } (*sp)++; - while ( isdigit(**sp) ) + while ( LDAP_DIGIT(**sp) ) (*sp)++; if ( **sp != '.' ) break; @@ -838,7 +837,7 @@ parse_noidlen(const char **sp, int *code, int *len, int allow_quoted) if ( **sp == '{' /*}*/ ) { (*sp)++; *len = atoi(*sp); - while ( isdigit(**sp) ) + while ( LDAP_DIGIT(**sp) ) (*sp)++; if ( **sp != /*{*/ '}' ) { *code = LDAP_SCHERR_UNEXPTOKEN; diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index b57ac9730c..9587adc4a8 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -16,7 +16,6 @@ #include -#include #include #include #include @@ -578,7 +577,7 @@ put_filter( BerElement *ber, char *str ) parens++; /* skip spaces */ - while( isspace( *str ) ) str++; + while( LDAP_SPACE( *str ) ) str++; switch ( *str ) { case '&': @@ -690,7 +689,7 @@ put_filter_list( BerElement *ber, char *str ) Debug( LDAP_DEBUG_TRACE, "put_filter_list \"%s\"\n", str, 0, 0 ); while ( *str ) { - while ( *str && isspace( (unsigned char) *str ) ) + while ( *str && LDAP_SPACE( (unsigned char) *str ) ) str++; if ( *str == '\0' ) break; diff --git a/libraries/libldap/sortctrl.c b/libraries/libldap/sortctrl.c index 5d6afb9898..c1374a2c4c 100644 --- a/libraries/libldap/sortctrl.c +++ b/libraries/libldap/sortctrl.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "ldap-int.h" @@ -48,7 +47,7 @@ static int countKeys(char *keyString) for (;;) { - while (isspace(*p)) /* Skip leading whitespace */ + while (LDAP_SPACE(*p)) /* Skip leading whitespace */ p++; if (*p == '\0') /* End of string? */ @@ -56,7 +55,7 @@ static int countKeys(char *keyString) 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') return count; } @@ -92,7 +91,7 @@ static int readNextKey( char **pNextKey, LDAPSortKey **key) int oidLen = 0; /* Skip leading white space. */ - while (isspace(*p)) + while (LDAP_SPACE(*p)) p++; if (*p == '-') /* Check if the reverse flag is present. */ diff --git a/libraries/libldap/ufn.c b/libraries/libldap/ufn.c index d5e1a5206b..db21748c8d 100644 --- a/libraries/libldap/ufn.c +++ b/libraries/libldap/ufn.c @@ -16,7 +16,6 @@ #include -#include #include #include #include diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index 468ad4d295..e6cf9e0753 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -28,7 +28,6 @@ #include -#include #include #include #include diff --git a/libraries/libldap/vlvctrl.c b/libraries/libldap/vlvctrl.c index b4f01e133a..889de2f411 100644 --- a/libraries/libldap/vlvctrl.c +++ b/libraries/libldap/vlvctrl.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "ldap-int.h" -- 2.39.5