]> git.sur5r.net Git - openldap/blob - libraries/liblutil/utils.c
Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers.
[openldap] / libraries / liblutil / utils.c
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-1999 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 <lutil.h>
13 #include <ldap_defaults.h>
14
15 char* lutil_progname( const char* name, int argc, char *argv[] )
16 {
17         char *progname;
18
19         if(argc == 0) {
20                 return strdup( name );
21         }
22
23         progname = strrchr ( argv[0], *LDAP_DIRSEP );
24         progname = strdup( progname ? &progname[1] : argv[0] );
25
26         return progname;
27 }