]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/getfilter.c
Minor bug fix in ldap_parse_extended_result.
[openldap] / libraries / libldap / getfilter.c
index e3cb60fd0ac3a3eca75a04b957ee7323f35f8109..efafeb5067658b1e2ff937a6fd4cb163a5a13542 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
@@ -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 */
@@ -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 {