mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Avoid recursion in NSLog
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20923 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
046aa11741
commit
ef3ab8c87e
3 changed files with 163 additions and 282 deletions
|
@ -1,3 +1,8 @@
|
|||
2005-03-18 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSPathUtilities.m: Use fprintf rather than NSLog to try to
|
||||
avoid possible recursion when errors occur.
|
||||
|
||||
2005-03-17 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSPathUtilities.m: Tidy variable and function names to fit
|
||||
|
|
|
@ -114,6 +114,15 @@
|
|||
|
||||
#define MGR() [NSFileManager defaultManager]
|
||||
|
||||
/*
|
||||
* NB. use fprintf() rather than NSLog() to avoid possibility of recursion
|
||||
* when features of NSLog() cause patrh utilities to be used.
|
||||
*/
|
||||
#define PrintOnce(format, args...) \
|
||||
do { static BOOL beenHere = NO; if (beenHere == NO) {\
|
||||
beenHere = YES; \
|
||||
fprintf(stderr, format, ## args); }} while (0)
|
||||
|
||||
/* ------------------ */
|
||||
/* Internal variables */
|
||||
/* ------------------ */
|
||||
|
@ -334,9 +343,9 @@ static NSString *setUserGNUstepPath(NSString *userName,
|
|||
dict = GSReadStepConfFile(steprcFile);
|
||||
if (dict != nil)
|
||||
{
|
||||
GSOnceFLog(@"Warning: Configuration: The file %s has been "
|
||||
@"deprecated. Please use the configuration file %s to "
|
||||
@"set standard paths.\n",
|
||||
PrintOnce("Warning: Configuration: The file %s has been "
|
||||
"deprecated. Please use the configuration file %s to "
|
||||
"set standard paths.\n",
|
||||
[steprcFile fileSystemRepresentation],
|
||||
stringify(GNUSTEP_CONFIGURATION_FILE));
|
||||
forceD = [[dict objectForKey: @"FORCE_DEFAULTS_ROOT"] boolValue];
|
||||
|
@ -444,27 +453,27 @@ static void InitialisePathUtilities(void)
|
|||
o = [d objectForKey: @"FORCE_DEFAULTS_ROOT"];
|
||||
if (o != nil)
|
||||
{
|
||||
GSOnceFLog(@"Warning: Configuration: "
|
||||
PrintOnce("Warning: Configuration: "
|
||||
"FORCE_DEFAULTS_ROOT is deprecated.\n");
|
||||
forceD = [o boolValue];
|
||||
}
|
||||
o = [d objectForKey: @"FORCE_USER_ROOT"];
|
||||
if (o != nil)
|
||||
{
|
||||
GSOnceFLog(@"Warning: Configuration: "
|
||||
PrintOnce("Warning: Configuration: "
|
||||
"FORCE_USER_ROOT is deprecated.\n");
|
||||
forceU = [o boolValue];
|
||||
}
|
||||
ASSIGN(oldDRoot, [d objectForKey: @"GNUSTEP_DEFAULTS_ROOT"]);
|
||||
if (oldDRoot != nil)
|
||||
{
|
||||
GSOnceFLog(@"Warning: Configuration: "
|
||||
PrintOnce("Warning: Configuration: "
|
||||
"GNUSTEP_DEFAULTS_ROOT is deprecated.\n");
|
||||
}
|
||||
ASSIGN(oldURoot, [d objectForKey: @"GNUSTEP_USER_ROOT"]);
|
||||
if (oldURoot != nil)
|
||||
{
|
||||
GSOnceFLog(@"Warning: Configuration: "
|
||||
PrintOnce("Warning: Configuration: "
|
||||
"GNUSTEP_USER_ROOT is deprecated.\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue