mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13481 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
14e6fa4d7c
commit
d8985d2652
4 changed files with 25 additions and 5 deletions
|
@ -4,7 +4,8 @@
|
|||
gdomap.
|
||||
* Source/NSDistributedNotification.m: Improved warnings about
|
||||
launching gdnc.
|
||||
* Source/NSException.m: Log uncaught exceptions using NSLog()
|
||||
* Source/NSException.m: Log uncaught exceptions with executable name.
|
||||
* Source/NSProcessInfo.m: New private function for exception msg.
|
||||
* Source/GSString.m: Applied fix by Malexander Malmberg for
|
||||
transmuting strings where the default encoding is not the same as
|
||||
the internal 8-bit encoding.
|
||||
|
|
|
@ -46,12 +46,13 @@ _preventRecursion (NSException *exception)
|
|||
static void
|
||||
_NSFoundationUncaughtExceptionHandler (NSException *exception)
|
||||
{
|
||||
BOOL a;
|
||||
BOOL a;
|
||||
extern const char* GSArgZero();
|
||||
|
||||
_NSUncaughtExceptionHandler = _preventRecursion;
|
||||
#if 0
|
||||
fprintf(stderr, "%s: Uncaught exception %s, reason: %s\n",
|
||||
[[exception name] lossyCString], [[exception reason] lossyCString]);
|
||||
#if 1
|
||||
fprintf(stderr, "%s: Uncaught exception %s, reason: %s\n", GSArgZero(),
|
||||
[[exception name] lossyCString], [[exception reason] lossyCString]);
|
||||
fflush(stderr); /* NEEDED UNDER MINGW */
|
||||
#else
|
||||
NSLog("Uncaught exception %@, reason: %@",
|
||||
|
|
|
@ -145,6 +145,8 @@ static NSProcessInfo *_gnu_sharedProcessInfoObject = nil;
|
|||
// Host name of the CPU executing the process
|
||||
static NSString *_gnu_hostName = nil;
|
||||
|
||||
static const char *_gnu_arg_zero = nil;
|
||||
|
||||
// Current process name
|
||||
static NSString *_gnu_processName = nil;
|
||||
|
||||
|
@ -167,6 +169,8 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
|||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
int i;
|
||||
|
||||
_gnu_arg_zero = argv[0];
|
||||
|
||||
/* Getting the process name */
|
||||
_gnu_processName = [[NSString stringWithCString: argv[0]] lastPathComponent];
|
||||
IF_NO_GC(RETAIN(_gnu_processName));
|
||||
|
@ -811,3 +815,15 @@ GSEnvironmentFlag(const char *name, BOOL def)
|
|||
return a;
|
||||
}
|
||||
|
||||
const char*
|
||||
GSArgZero()
|
||||
{
|
||||
if (_gnu_arg_zero == 0)
|
||||
[NSProcessInfo class];
|
||||
if (_gnu_arg_zero == 0)
|
||||
return "";
|
||||
else
|
||||
return _gnu_arg_zero;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -33,6 +33,8 @@ main(int argc, char *argv[], char **env)
|
|||
#endif
|
||||
arp = [NSAutoreleasePool new];
|
||||
|
||||
printf(" GNUstep bundle directory is %s\n", [[[NSBundle gnustepBundle] bundlePath] cString]);
|
||||
|
||||
main = [NSBundle mainBundle];
|
||||
printf("Looking for main bundle...\n");
|
||||
if (!main) {
|
||||
|
|
Loading…
Reference in a new issue