mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 08:09:34 -05:00
Avoid locale specific ctype routines.
This commit is contained in:
parent
aa4a44263d
commit
49d73e12a7
17 changed files with 15 additions and 32 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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 ) {
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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. */
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue