diff --git a/ChangeLog b/ChangeLog index 963b93614..dadb03a24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-03-09 Richard Frith-Macdonald + + * Source/NSProcessInfo.m: On mswindows, don't count a '.exe' + extension as part of the process name. + * Source/NSUserDefaults.m: Revert last change ... now done in + NSProcessInfo.m + 2007-03-08 Richard Frith-Macdonald * Source/Addictions/GSXML.m: Cope with cancellation of load from URL diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index 853461566..6a0f335df 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -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 */ diff --git a/Source/NSUserDefaults.m b/Source/NSUserDefaults.m index b35815067..97ef04326 100644 --- a/Source/NSUserDefaults.m +++ b/Source/NSUserDefaults.m @@ -714,14 +714,6 @@ static BOOL setSharedDefaults = NO; /* Flag to prevent infinite recursion */ { NSString *s = [[NSProcessInfo processInfo] processName]; -#if defined(__MINGW32__) - NSString *e = [s pathExtension]; - - if (e != nil && [e caseInsensitiveCompare: @"EXE"] == NSOrderedSame) - { - s = [s stringByDeletingPathExtension]; - } -#endif processName = [s copy]; }