Check for bad paths in config file.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22069 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2005-11-22 07:57:07 +00:00
parent e8a16aaeb8
commit e15a2770fb
2 changed files with 29 additions and 2 deletions

View file

@ -6,7 +6,10 @@
* Tools/gdnc.m:
Use the NSPortIsMessagePort user default consistently to control
whether socket or message ports are used by default. Remove mingw32
sp[ecific GSMailslot user default.
specific GSMailslot user default.
Source/NSPathUtilities.m: Check for illegal paths (ones which don't
appear to be absolute paths) specified in config file ... warn about
the bad config, but try to guess what they shjould be for mingw32
2005-11-20 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -233,7 +233,31 @@ getPathConfig(NSDictionary *dict, NSString *key)
NSString *path;
path = [dict objectForKey: key];
path = getPath(path);
if (path != nil)
{
path = getPath(path);
if ([path isAbsolutePath] == NO)
{
NSLog(@"GNUstep configuration file entry '%@' ('%@') is not "
@"an absolute path. Please fix your configuration file",
key, [dict objectForKey: key]);
#if defined(__MINGW32_)
if ([path length] > 2)
{
unichar buf[3];
[path getCharacters: buf range: NSMakeRange(0, 3)];
if ((buf[0] == '/' || bug[0] == '\\') && isalpha(buf[1])
&& (buf[2] == '/' || bug[2] == '\\'))
{
path = [NSString stringWithFormat: @"%c:%@", (char)buf[1],
[path substringFromindex: 2]];
NSLog(@"I am guessing that you meant '%@'", path);
}
}
#endif
}
}
return path;
}