]> git.sur5r.net Git - openldap/blobdiff - clients/tools/ldapsearch.c
Rework saslRegex code (not yet tested)
[openldap] / clients / tools / ldapsearch.c
index 471e20a07a8092a7d9c6425ce8f5ac964078eaee..836752f257d26f1903cda0ea33c7404b441ecc12 100644 (file)
@@ -186,7 +186,7 @@ main( int argc, char **argv )
        LDAP            *ld = NULL;
        int             valuesReturnFilter;
        BerElement      *ber;
-       struct berval   *bvalp;
+       struct berval   *bvalp = NULL;
        char    *vrFilter  = NULL, *control  = NULL, *s;
 
 
@@ -194,6 +194,8 @@ main( int argc, char **argv )
        debug = verbose = not = vals2tmp = referrals = valuesReturnFilter =
                attrsonly = manageDSAit = ldif = want_bindpw = 0;
 
+       prog = lutil_progname( "ldapsearch", argc, argv );
+
        lutil_log_initialize(argc, argv);
 
        deref = sizelimit = timelimit = version = -1;
@@ -223,8 +225,6 @@ main( int argc, char **argv )
 
        urlize( def_urlpre );
 
-    prog = (prog = strrchr(argv[0], *LDAP_DIRSEP)) == NULL ? argv[0] : prog + 1;
-
        while (( i = getopt( argc, argv, "Aa:b:E:F:f:Ll:S:s:T:tuz:"
                "Cd:D:h:H:IkKMnO:p:P:QR:U:vw:WxX:Y:Z")) != EOF )
        {
@@ -890,7 +890,6 @@ main( int argc, char **argv )
                }
 
                if ( valuesReturnFilter ) {
-                       struct berval *bvalp;
                        ctrls[i++]=&c2;
                        ctrls[i] = NULL;