]> git.sur5r.net Git - openldap/blob - libraries/liblutil/utils.c
Rework SASL command line arguments. Default is now to authenticate
[openldap] / libraries / liblutil / utils.c
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6
7 #include "portable.h"
8
9 #include <ac/stdlib.h>
10 #include <ac/string.h>
11
12 #include <lber.h>
13 #include <lutil.h>
14 #include <ldap_defaults.h>
15
16 char* lutil_progname( const char* name, int argc, char *argv[] )
17 {
18         char *progname;
19
20         if(argc == 0) {
21                 return ber_strdup( name );
22         }
23
24         progname = strrchr ( argv[0], *LDAP_DIRSEP );
25         progname = ber_strdup( progname ? &progname[1] : argv[0] );
26
27         return progname;
28 }