drop .exe extension for process name on windows

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24832 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2007-03-09 08:48:09 +00:00
parent c6fb5029cf
commit 8bb559b207
3 changed files with 20 additions and 8 deletions

View file

@ -275,6 +275,19 @@ _gnu_process_args(int argc, char *argv[], char *env[])
/* Getting the process name */
IF_NO_GC(RELEASE(_gnu_processName));
_gnu_processName = [arg0 lastPathComponent];
#if defined(__MINGW32__)
/* On windows we remove any .exe extension for consistency with app names
* under unix
*/
{
NSString *e = [_gnu_processName pathExtension];
if (e != nil && [e caseInsensitiveCompare: @"EXE"] == NSOrderedSame)
{
_gnu_processName = [_gnu_processName stringByDeletingPathExtension];
}
}
#endif
IF_NO_GC(RETAIN(_gnu_processName));
/* Copy the argument list */