mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
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:
parent
e8a16aaeb8
commit
e15a2770fb
2 changed files with 29 additions and 2 deletions
|
@ -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>
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue