mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Tidyups and minor fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16713 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3ca0345dbd
commit
5318b808c6
3 changed files with 41 additions and 13 deletions
|
@ -1,3 +1,10 @@
|
|||
2003-05-13 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Tools/gdnc.m: Tidy termination code.
|
||||
* Source/Additions/GSMime.m: ([GSMimeDocument-copyWithZone:])
|
||||
corrected implementation to do a real copy rather than just a
|
||||
retain.
|
||||
|
||||
2003-05-13 15:57 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Tools/gdnc.m (ihandler): Declare variables.
|
||||
|
|
|
@ -3617,9 +3617,26 @@ static NSCharacterSet *tokenSet = nil;
|
|||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a copy of the receiver.
|
||||
*/
|
||||
- (id) copyWithZone: (NSZone*)z
|
||||
{
|
||||
return RETAIN(self);
|
||||
GSMimeDocument *c = [GSMimeDocument allocWithZone: z];
|
||||
|
||||
c->headers = [[NSMutableArray allocWithZone: z] initWithArray: headers
|
||||
copyItems: YES];
|
||||
|
||||
if ([content isKindOfClass: [NSArray class]] == YES)
|
||||
{
|
||||
c->content = [[NSMutableArray allocWithZone: z] initWithArray: content
|
||||
copyItems: YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
c->content = [content copy];
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
|
|
28
Tools/gdnc.m
28
Tools/gdnc.m
|
@ -37,16 +37,19 @@
|
|||
static void
|
||||
ihandler(int sig)
|
||||
{
|
||||
int i;
|
||||
char *e;
|
||||
static BOOL beenHere = NO;
|
||||
BOOL action;
|
||||
const char *e;
|
||||
|
||||
/*
|
||||
* Reset signals to avoid recursive call of handler.
|
||||
* Deal with recursive call of handler.
|
||||
*/
|
||||
for (i = 0; i < NSIG; i++)
|
||||
if (beenHere == YES)
|
||||
{
|
||||
signal(i, SIG_DFL);
|
||||
abort();
|
||||
}
|
||||
beenHere = YES;
|
||||
|
||||
/*
|
||||
* If asked to terminate, do so cleanly.
|
||||
*/
|
||||
|
@ -56,29 +59,30 @@ ihandler(int sig)
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
i = 1; // abort() by default.
|
||||
action = YES; // abort() by default.
|
||||
#else
|
||||
i = 0; // kill() or exit() by default.
|
||||
action = NO; // exit() by default.
|
||||
#endif
|
||||
e = getenv("CRASH_ON_ABORT");
|
||||
if (e != 0)
|
||||
{
|
||||
if (strcasecmp(e, "yes") == 0 || strcasecmp(e, "true") == 0)
|
||||
i = 1;
|
||||
action = YES;
|
||||
else if (strcasecmp(e, "no") == 0 || strcasecmp(e, "false") == 0)
|
||||
i = 0;
|
||||
action = NO;
|
||||
else if (isdigit(*e) && *e != '0')
|
||||
i = 1;
|
||||
action = YES;
|
||||
else
|
||||
i = 0;
|
||||
action = NO;
|
||||
}
|
||||
|
||||
if (i == 1)
|
||||
if (action == YES)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "gdnc killed by signal %d\n", sig);
|
||||
exit(sig);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue