]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/getfilter.c
Fix #undef LDAP_UFN
[openldap] / libraries / libldap / getfilter.c
index 2d8b89c8a8d68672e17d8bc39e2c817f556153f0..e6570187ccb74dcd48b43f952e0e5a477f909cd3 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <ac/stdlib.h>
 
-#include <ac/ctype.h>
 #include <ac/errno.h>
 #include <ac/regex.h>
 #include <ac/string.h>
@@ -123,14 +122,13 @@ ldap_init_getfilter_buf( char *buf, ber_len_t buflen )
            nextflp->lfl_tag = LDAP_STRDUP( tag );
            nextflp->lfl_pattern = tok[ 0 ];
            if ( (rc = regcomp( &re, nextflp->lfl_pattern, 0 )) != 0 ) {
-#ifdef LDAP_LIBUI
                char error[512];
                regerror(rc, &re, error, sizeof(error));
                ldap_getfilter_free( lfdp );
-               fprintf( stderr, "bad regular expression %s, %s\n",
-                       nextflp->lfl_pattern, error );
+               Debug( LDAP_DEBUG_ANY, "ldap_init_get_filter_buf: "
+                       "bad regular expression %s, %s\n",
+                       nextflp->lfl_pattern, error, 0 );
                errno = EINVAL;
-#endif /* LDAP_LIBUI */
                LDAP_VFREE( tok );
                return( NULL );
            }
@@ -347,12 +345,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 ) {
@@ -371,7 +369,7 @@ ldap_build_filter(
                                    *f++ = ' ';
                                }
                                slen = strlen( valwords[ i ] );
-                               SAFEMEMCPY( f, valwords[ i ], slen );
+                               AC_MEMCPY( f, valwords[ i ], slen );
                                f += slen;
                            }
                        }
@@ -380,17 +378,17 @@ ldap_build_filter(
                        if ( wordcount > 0 ) {
                            wordnum = wordcount - 1;
                            slen = strlen( valwords[ wordnum ] );
-                           SAFEMEMCPY( f, valwords[ wordnum ], slen );
+                           AC_MEMCPY( f, valwords[ wordnum ], slen );
                            f += slen;
                        }
                    } else if ( value != NULL ) {
                        slen = strlen( value );
-                       SAFEMEMCPY( f, value, slen );
+                       AC_MEMCPY( f, value, slen );
                        f += slen;
                    }
                } else if ( *p == 'a' && attr != NULL ) {
                    slen = strlen( attr );
-                   SAFEMEMCPY( f, attr, slen );
+                   AC_MEMCPY( f, attr, slen );
                    f += slen;
                } else {
                    *f++ = *p;