1999-09-09 03:06:24 +08:00
|
|
|
/* $OpenLDAP$ */
|
1999-08-18 03:00:59 +08:00
|
|
|
/*
|
2000-05-13 10:36:07 +08:00
|
|
|
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
|
1999-08-18 03:00:59 +08:00
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "portable.h"
|
|
|
|
|
|
|
|
#include <ac/stdlib.h>
|
|
|
|
#include <ac/string.h>
|
|
|
|
|
2000-06-08 02:49:36 +08:00
|
|
|
#include <lber.h>
|
1999-08-18 03:00:59 +08:00
|
|
|
#include <lutil.h>
|
|
|
|
#include <ldap_defaults.h>
|
|
|
|
|
|
|
|
char* lutil_progname( const char* name, int argc, char *argv[] )
|
|
|
|
{
|
|
|
|
char *progname;
|
|
|
|
|
|
|
|
if(argc == 0) {
|
2000-06-07 14:33:59 +08:00
|
|
|
return ber_strdup( name );
|
1999-08-18 03:00:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
progname = strrchr ( argv[0], *LDAP_DIRSEP );
|
2000-06-07 14:33:59 +08:00
|
|
|
progname = ber_strdup( progname ? &progname[1] : argv[0] );
|
1999-08-18 03:00:59 +08:00
|
|
|
|
|
|
|
return progname;
|
|
|
|
}
|