]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/getfilter.c
Avoid locale specific ctype routines.
[openldap] / libraries / libldap / getfilter.c
index efafeb5067658b1e2ff937a6fd4cb163a5a13542..c837631e6d65f3acd36ea3b4dfca7f73a62cc223 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 /*  Portions
@@ -16,7 +16,6 @@
 
 #include <ac/stdlib.h>
 
-#include <ac/ctype.h>
 #include <ac/errno.h>
 #include <ac/regex.h>
 #include <ac/string.h>
@@ -102,7 +101,7 @@ ldap_init_getfilter_buf( char *buf, ber_len_t buflen )
     fip = NULL;
     tag = NULL;
 
-    while ( buflen > 0 && ( tokcnt = next_line_tokens( &buf, &buflen, &tok ))
+    while ( buflen > 0 && ( tokcnt = ldap_int_next_line_tokens( &buf, &buflen, &tok ))
            > 0 ) {
 
        switch( tokcnt ) {
@@ -131,7 +130,7 @@ ldap_init_getfilter_buf( char *buf, ber_len_t buflen )
                        nextflp->lfl_pattern, error );
                errno = EINVAL;
 #endif /* LDAP_LIBUI */
-               free_strarray( tok );
+               LDAP_VFREE( tok );
                return( NULL );
            }
                regfree(&re);
@@ -157,7 +156,7 @@ ldap_init_getfilter_buf( char *buf, ber_len_t buflen )
                if (( nextfip = (LDAPFiltInfo *)LDAP_CALLOC( 1,
                        sizeof( LDAPFiltInfo ))) == NULL ) {
                    ldap_getfilter_free( lfdp );
-                   free_strarray( tok );
+                   LDAP_VFREE( tok );
                    return( NULL );
                }
                if ( fip == NULL ) {    /* first one */
@@ -177,7 +176,7 @@ ldap_init_getfilter_buf( char *buf, ber_len_t buflen )
                    } else if ( strcasecmp( tok[ 2 ], "base" ) == 0 ) {
                        nextfip->lfi_scope = LDAP_SCOPE_BASE;
                    } else {
-                       free_strarray( tok );
+                       LDAP_VFREE( tok );
                        ldap_getfilter_free( lfdp );
                        errno = EINVAL;
                        return( NULL );
@@ -194,7 +193,7 @@ ldap_init_getfilter_buf( char *buf, ber_len_t buflen )
            break;
 
        default:
-           free_strarray( tok );
+           LDAP_VFREE( tok );
            ldap_getfilter_free( lfdp );
            errno = EINVAL;
            return( NULL );
@@ -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 ) {