]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/getfilter.c
Fix == typo
[openldap] / libraries / libldap / getfilter.c
index bf75521457ba02ae5672d473ddd14dddb2af364a..efafeb5067658b1e2ff937a6fd4cb163a5a13542 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
@@ -83,7 +84,7 @@ ldap_init_getfilter( LDAP_CONST char *fname )
 
 
 LDAPFiltDesc *
-ldap_init_getfilter_buf( char *buf, long buflen )
+ldap_init_getfilter_buf( char *buf, ber_len_t buflen )
 {
     LDAPFiltDesc       *lfdp;
     LDAPFiltList       *flp, *nextflp;
@@ -243,17 +244,17 @@ ldap_getfirstfilter(
 
        for ( flp = lfdp->lfd_filtlist; flp != NULL; flp = flp->lfl_next ) {
                /* compile tagpat, continue if we fail */
-               if (regcomp(&re, tagpat, 0) != 0)
+               if (regcomp(&re, tagpat, REG_EXTENDED|REG_NOSUB) != 0)
                        continue;
 
-               /* match tagpatern and tag, continue if we fail */
+               /* match tagpattern and tag, continue if we fail */
                rc = regexec(&re, flp->lfl_tag, 0, NULL, 0);
                regfree(&re);
                if (rc != 0)
                        continue;
 
                /* compile flp->ifl_pattern, continue if we fail */
-               if (regcomp(&re, flp->lfl_pattern, 0) != 0)
+               if (regcomp(&re, flp->lfl_pattern, REG_EXTENDED|REG_NOSUB) != 0)
                        continue;
 
                /* match ifl_pattern and lfd_curval, continue if we fail */
@@ -314,7 +315,7 @@ ldap_getnextfilter( LDAPFiltDesc *lfdp )
 void
 ldap_build_filter(
        char *filtbuf,
-       unsigned long buflen,
+       ber_len_t buflen,
        LDAP_CONST char *pattern,
        LDAP_CONST char *prefix,
        LDAP_CONST char *suffix,
@@ -398,15 +399,14 @@ ldap_build_filter(
                *f++ = *p;
            }
                
-           if ( (unsigned long) (f - filtbuf) > buflen ) {
+           if ( (size_t) (f - filtbuf) > buflen ) {
                /* sanity check */
                --f;
                break;
            }
        }
 
-       if ( suffix != NULL && (
-               (unsigned long) ( f - filtbuf ) < buflen ) )
+       if ( suffix != NULL && ( (size_t) (f - filtbuf) < buflen ) )
        {
            strcpy( f, suffix );
        } else {