mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-14 10:00:55 +00:00
Add more checks/warnings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22127 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
57e466d642
commit
21fa587569
2 changed files with 44 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-12-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSpathUtilities.m: Add more checks/warnings about improper
|
||||||
|
configuration.
|
||||||
|
|
||||||
2005-11-28 Richard Frith-Macdonald <rfm@gnu.org>
|
2005-11-28 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Headers/Additions/GNUstepBase/GSConfig.h.in:
|
* Headers/Additions/GNUstepBase/GSConfig.h.in:
|
||||||
|
|
|
@ -254,6 +254,8 @@ getPathConfig(NSDictionary *dict, NSString *key)
|
||||||
{
|
{
|
||||||
path = [NSString stringWithFormat: @"%c:%@", (char)buf[1],
|
path = [NSString stringWithFormat: @"%c:%@", (char)buf[1],
|
||||||
[path substringFromindex: 2]];
|
[path substringFromindex: 2]];
|
||||||
|
path = [path stringByReplacingString: @"/"
|
||||||
|
withString: @"\\"];
|
||||||
NSLog(@"I am guessing that you meant '%@'", path);
|
NSLog(@"I am guessing that you meant '%@'", path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,6 +399,7 @@ GNUstepConfig(NSDictionary *newConfig)
|
||||||
if (newConfig == nil)
|
if (newConfig == nil)
|
||||||
{
|
{
|
||||||
NSString *file = nil;
|
NSString *file = nil;
|
||||||
|
BOOL fromEnvironment = YES;
|
||||||
|
|
||||||
conf = [[NSMutableDictionary alloc] initWithCapacity: 32];
|
conf = [[NSMutableDictionary alloc] initWithCapacity: 32];
|
||||||
|
|
||||||
|
@ -407,6 +410,7 @@ GNUstepConfig(NSDictionary *newConfig)
|
||||||
#endif
|
#endif
|
||||||
if (file == nil)
|
if (file == nil)
|
||||||
{
|
{
|
||||||
|
fromEnvironment = NO;
|
||||||
file = [NSString stringWithCString:
|
file = [NSString stringWithCString:
|
||||||
STRINGIFY(GNUSTEP_CONFIG_FILE)];
|
STRINGIFY(GNUSTEP_CONFIG_FILE)];
|
||||||
}
|
}
|
||||||
|
@ -428,8 +432,41 @@ GNUstepConfig(NSDictionary *newConfig)
|
||||||
// Join the two together
|
// Join the two together
|
||||||
file = [path stringByAppendingPathComponent: file];
|
file = [path stringByAppendingPathComponent: file];
|
||||||
}
|
}
|
||||||
gnustepConfigPath = [file stringByDeletingLastPathComponent];
|
|
||||||
RETAIN(gnustepConfigPath);
|
if ([file isAbsolutePath] == NO)
|
||||||
|
{
|
||||||
|
if (fromEnvironment == YES)
|
||||||
|
{
|
||||||
|
NSLog(@"GNUSTEP_CONFIG_FILE value ('%@') is not "
|
||||||
|
@"an absolute path. Please fix the environment "
|
||||||
|
@"variable.", file);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSLog(@"GNUSTEP_CONFIG_FILE value ('%@') is not "
|
||||||
|
@"an absolute path. Please rebuild GNUstep-base "
|
||||||
|
@"specifying a valid path to the config file.", file);
|
||||||
|
}
|
||||||
|
#if defined(__MINGW32_)
|
||||||
|
if ([file length] > 2)
|
||||||
|
{
|
||||||
|
unichar buf[3];
|
||||||
|
|
||||||
|
[file getCharacters: buf range: NSMakeRange(0, 3)];
|
||||||
|
if ((buf[0] == '/' || bug[0] == '\\') && isalpha(buf[1])
|
||||||
|
&& (buf[2] == '/' || bug[2] == '\\'))
|
||||||
|
{
|
||||||
|
file = [NSString stringWithFormat: @"%c:%@",
|
||||||
|
(char)buf[1], [file substringFromindex: 2]];
|
||||||
|
file = [file stringByReplacingString: @"/"
|
||||||
|
withString: @"\\"];
|
||||||
|
NSLog(@"I am guessing that you meant '%@'", file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
gnustepConfigPath
|
||||||
|
= RETAIN([file stringByDeletingLastPathComponent]);
|
||||||
ParseConfigurationFile(file, conf);
|
ParseConfigurationFile(file, conf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue