openldap/libraries/liblutil/utils.c
Kurt Zeilenga 4933f894ba Include <lber.h> to use ber_strdup(). (probably should create/use
macros LUTIL_STRDUP and friends).
2000-06-07 18:49:36 +00:00

29 lines
543 B
C

/* $OpenLDAP$ */
/*
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#include "portable.h"
#include <ac/stdlib.h>
#include <ac/string.h>
#include <lber.h>
#include <lutil.h>
#include <ldap_defaults.h>
char* lutil_progname( const char* name, int argc, char *argv[] )
{
char *progname;
if(argc == 0) {
return ber_strdup( name );
}
progname = strrchr ( argv[0], *LDAP_DIRSEP );
progname = ber_strdup( progname ? &progname[1] : argv[0] );
return progname;
}