mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-30 10:29:28 -05:00
ITS#5604: Normalize lutil_progname(): strip .exe from Windows executable names
This commit is contained in:
parent
b9930aef96
commit
4f935126c4
1 changed files with 7 additions and 0 deletions
|
|
@ -77,6 +77,13 @@ char* lutil_progname( const char* name, int argc, char *argv[] )
|
|||
LUTIL_SLASHPATH( argv[0] );
|
||||
progname = strrchr ( argv[0], *LDAP_DIRSEP );
|
||||
progname = progname ? &progname[1] : argv[0];
|
||||
#ifdef _WIN32
|
||||
{
|
||||
size_t len = strlen( progname );
|
||||
if ( len > 4 && strcasecmp( &progname[len - 4], ".exe" ) == 0 )
|
||||
progname[len - 4] = '\0';
|
||||
}
|
||||
#endif
|
||||
return progname;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue