Various bugfixes etc.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13479 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-04-16 13:48:14 +00:00
parent 835d5caf6b
commit 14e6fa4d7c
6 changed files with 58 additions and 51 deletions

View file

@ -1,3 +1,16 @@
2002-04-16 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSPortNameServer.m: Improved warnings about launching
gdomap.
* Source/NSDistributedNotification.m: Improved warnings about
launching gdnc.
* Source/NSException.m: Log uncaught exceptions using NSLog()
* 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.
* Source/Unicode.m: Logic fix for selecting strict conversion from
unicode by Alexander Malmberg.
2002-04-12 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSXML.m: New method ([-nextElement]) to traverse

View file

@ -1665,11 +1665,15 @@ transmute(ivars self, NSString *aString)
*/
transmute = NO;
}
else if ([aString canBeConvertedToEncoding: intEnc] == YES)
else if (intEnc == defEnc
&& [aString canBeConvertedToEncoding: intEnc] == YES)
{
/*
* The other string can be converted to the internal 8-bit encoding,
* so we don't need to transmute, but we can *not* use its ivars.
* via the cString method, so we don't need to transmute, but we
* can *not* use its ivars.
* NB. If 'intEnc != defEnc' the cString method of the other string
* will not return data in the internal encoding.
*/
transmute = NO;
other = 0;

View file

@ -42,16 +42,6 @@
#include "../Tools/gdnc.h"
/*
* Macros to build text to start name server and to give an error
* message about it - they include installation path information.
*/
#define MAKE_GDNC_CMD [GSSystemRootDirectory() \
stringByAppendingPathComponent: @"Tools/gdnc"]
#define MAKE_GDNC_ERR [NSString stringWithFormat: \
@"check that %@/Tools/gdnc is running", \
GSSystemRootDirectory()]
/*
* Global variables for distributed notification center types.
*/
@ -393,32 +383,32 @@ static NSDistributedNotificationCenter *defCenter = nil;
}
else
{
static BOOL recursion = NO;
static BOOL recursion = NO;
static NSString *cmd = nil;
static NSArray *args = nil;
if (recursion == NO)
{
static NSString *cmd = nil;
static NSArray *args = nil;
NSLog(@"\nI couldn't contact the notification server for %@ -\n"
@"so I'm attempting to to start one - which will take a few seconds.\n"
@"It is recommended that you start the notification server (gdnc) either at\n"
@"login or (better) when your computer is started up.\n", description);
if (cmd == nil)
{
#if 1
cmd = RETAIN([[NSSearchPathForDirectoriesInDomains(
GSToolsDirectory, NSSystemDomainMask, YES) objectAtIndex: 0]
stringByAppendingPathComponent: @"gdnc"]);
#else
cmd = MAKE_GDNC_CMD;
#endif
if ([host length] > 0)
{
args = [[NSArray alloc] initWithObjects:
@"-NSHost", host, nil];
}
}
}
if (recursion == NO && cmd != nil)
{
NSLog(@"\nI couldn't contact the notification server for %@ -\n"
@"so I'm attempting to to start one - which will take a few seconds.\n"
@"Trying to launch gdnc from %@ or a machine/operating-system subdirectory.\n"
@"It is recommended that you start the notification server (gdnc) either at\n"
@"login or (better) when your computer is started up.\n", description,
[cmd stringByDeletingLastPathComponent]);
if ([host length] > 0)
{
args = [[NSArray alloc] initWithObjects:
@"-NSHost", host, nil];
}
[NSTask launchedTaskWithLaunchPath: cmd arguments: args];
@ -435,8 +425,8 @@ static NSDistributedNotificationCenter *defCenter = nil;
{
recursion = NO;
[NSException raise: NSInternalInconsistencyException
format: @"unable to contact GDNC server - %@",
MAKE_GDNC_ERR];
format: @"unable to contact GDNC server -\n"
@"please check that the gdnc process is running."];
}
}
}

View file

@ -39,6 +39,8 @@
static void
_preventRecursion (NSException *exception)
{
fprintf(stderr, "recursion encountered handling uncaught exception\n");
fflush(stderr); /* NEEDED UNDER MINGW */
}
static void
@ -47,13 +49,14 @@ _NSFoundationUncaughtExceptionHandler (NSException *exception)
BOOL a;
_NSUncaughtExceptionHandler = _preventRecursion;
fprintf(stderr, "Uncaught exception %s, reason: %s\n",
#if 0
fprintf(stderr, "%s: Uncaught exception %s, reason: %s\n",
[[exception name] lossyCString], [[exception reason] lossyCString]);
fflush(stderr); /* NEEDED UNDER MINGW */
/* FIXME: need to implement this:
NSLogError("Uncaught exception %@, reason: %@",
[exception name], [exception reason]);
*/
#else
NSLog("Uncaught exception %@, reason: %@",
[exception name], [exception reason]);
#endif
#ifdef DEBUG
a = YES; // abort() by default.

View file

@ -56,16 +56,6 @@
*/
#include "../Tools/gdomap.h"
/*
* Macros to build text to start name server and to give an error
* message about it - they include installation path information.
*/
#define MAKE_GDOMAP_CMD [[GSSystemRootDirectory() \
stringByAppendingPathComponent: @"Tools"] \
stringByAppendingPathComponent: @"gdomap"]
#define MAKE_GDOMAP_ERR [NSString stringWithFormat: \
@"check that %@/Tools/gdomap is running", GSSystemRootDirectory()]
#define stringify_it(X) #X
#define make_gdomap_port(X) stringify_it(X)
@ -187,15 +177,23 @@ typedef enum {
* Remove our file handle, then either retry or fail.
*/
[self close];
if (state == GSPC_LOPEN)
if (launchCmd == nil)
{
launchCmd = RETAIN([[NSSearchPathForDirectoriesInDomains(
GSToolsDirectory, NSSystemDomainMask, YES) objectAtIndex: 0]
stringByAppendingPathComponent: @"gdomap"]);
}
if (state == GSPC_LOPEN && launchCmd != nil)
{
NSRunLoop *loop = [NSRunLoop currentRunLoop];
NSTimer *timer;
NSLog(@"NSPortNameServer attempting to start gdomap on local host\n"
@"This will take a few seconds.\n"
@"Trying to launch gdomap from %@ or a machine/operating-system subdirectory.\n"
@"It is recommended that you start up gdomap at login time or (better) when\n"
@"your computer is started instead.");
@"your computer is started instead.",
[launchCmd stringByDeletingLastPathComponent]);
[NSTask launchedTaskWithLaunchPath: launchCmd arguments: nil];
timer = [NSTimer timerWithTimeInterval: 5.0
invocation: nil
@ -548,7 +546,6 @@ typedef enum {
serverPort = RETAIN([NSString stringWithCString:
make_gdomap_port(GDOMAP_PORT_OVERRIDE)]);
#endif
launchCmd = RETAIN(MAKE_GDOMAP_CMD);
portClass = [GSTcpPort class];
}
}

View file

@ -1963,7 +1963,7 @@ bases:
#endif
tables:
if (strict == YES)
if (strict == NO)
{
while (spos < slen)
{