]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/search.c
Remove lint
[openldap] / libraries / libldap / search.c
index 84a58f3b026fdc157cd3beabe85f7880fe7d750f..cb31e0f1bd5065e10c18050b5770d088e69b3626 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
@@ -307,7 +307,11 @@ ldap_build_search_req(
                return( NULL );
        }
 
-       filter = LDAP_STRDUP( filter_in );
+       if( filter_in != NULL ) {
+               filter = LDAP_STRDUP( filter_in );
+       } else {
+               filter = LDAP_STRDUP( "(objectclass=*)" );
+       }
        err = put_filter( ber, filter );
        LDAP_FREE( filter );
 
@@ -424,12 +428,12 @@ static int hex2value( int c )
 }
 
 char *
-ldap_pvt_find_wildcard( char *s )
+ldap_pvt_find_wildcard( const char *s )
 {
        for( ; *s != '\0' ; s++ ) {
                switch( *s ) {
                case '*':       /* found wildcard */
-                       return s;
+                       return (char *) s;
 
                case '\\':
                        s++; /* skip over escape */
@@ -568,6 +572,10 @@ put_filter( BerElement *ber, char *str )
                case '(':
                        str++;
                        parens++;
+
+                       /* skip spaces */
+                       while( isspace( *str ) ) str++;
+
                        switch ( *str ) {
                        case '&':
                                Debug( LDAP_DEBUG_TRACE, "put_filter: AND\n",