mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
e1274f9986
commit
45be633f1e
4 changed files with 25 additions and 5 deletions
|
@ -4,7 +4,8 @@
|
||||||
gdomap.
|
gdomap.
|
||||||
* Source/NSDistributedNotification.m: Improved warnings about
|
* Source/NSDistributedNotification.m: Improved warnings about
|
||||||
launching gdnc.
|
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
|
* Source/GSString.m: Applied fix by Malexander Malmberg for
|
||||||
transmuting strings where the default encoding is not the same as
|
transmuting strings where the default encoding is not the same as
|
||||||
the internal 8-bit encoding.
|
the internal 8-bit encoding.
|
||||||
|
|
|
@ -46,12 +46,13 @@ _preventRecursion (NSException *exception)
|
||||||
static void
|
static void
|
||||||
_NSFoundationUncaughtExceptionHandler (NSException *exception)
|
_NSFoundationUncaughtExceptionHandler (NSException *exception)
|
||||||
{
|
{
|
||||||
BOOL a;
|
BOOL a;
|
||||||
|
extern const char* GSArgZero();
|
||||||
|
|
||||||
_NSUncaughtExceptionHandler = _preventRecursion;
|
_NSUncaughtExceptionHandler = _preventRecursion;
|
||||||
#if 0
|
#if 1
|
||||||
fprintf(stderr, "%s: Uncaught exception %s, reason: %s\n",
|
fprintf(stderr, "%s: Uncaught exception %s, reason: %s\n", GSArgZero(),
|
||||||
[[exception name] lossyCString], [[exception reason] lossyCString]);
|
[[exception name] lossyCString], [[exception reason] lossyCString]);
|
||||||
fflush(stderr); /* NEEDED UNDER MINGW */
|
fflush(stderr); /* NEEDED UNDER MINGW */
|
||||||
#else
|
#else
|
||||||
NSLog("Uncaught exception %@, reason: %@",
|
NSLog("Uncaught exception %@, reason: %@",
|
||||||
|
|
|
@ -145,6 +145,8 @@ static NSProcessInfo *_gnu_sharedProcessInfoObject = nil;
|
||||||
// Host name of the CPU executing the process
|
// Host name of the CPU executing the process
|
||||||
static NSString *_gnu_hostName = nil;
|
static NSString *_gnu_hostName = nil;
|
||||||
|
|
||||||
|
static const char *_gnu_arg_zero = nil;
|
||||||
|
|
||||||
// Current process name
|
// Current process name
|
||||||
static NSString *_gnu_processName = nil;
|
static NSString *_gnu_processName = nil;
|
||||||
|
|
||||||
|
@ -167,6 +169,8 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
||||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
_gnu_arg_zero = argv[0];
|
||||||
|
|
||||||
/* Getting the process name */
|
/* Getting the process name */
|
||||||
_gnu_processName = [[NSString stringWithCString: argv[0]] lastPathComponent];
|
_gnu_processName = [[NSString stringWithCString: argv[0]] lastPathComponent];
|
||||||
IF_NO_GC(RETAIN(_gnu_processName));
|
IF_NO_GC(RETAIN(_gnu_processName));
|
||||||
|
@ -811,3 +815,15 @@ GSEnvironmentFlag(const char *name, BOOL def)
|
||||||
return a;
|
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
|
#endif
|
||||||
arp = [NSAutoreleasePool new];
|
arp = [NSAutoreleasePool new];
|
||||||
|
|
||||||
|
printf(" GNUstep bundle directory is %s\n", [[[NSBundle gnustepBundle] bundlePath] cString]);
|
||||||
|
|
||||||
main = [NSBundle mainBundle];
|
main = [NSBundle mainBundle];
|
||||||
printf("Looking for main bundle...\n");
|
printf("Looking for main bundle...\n");
|
||||||
if (!main) {
|
if (!main) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue