MINGW fixes to home directory stuff.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9276 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-03-03 09:14:56 +00:00
parent 70494ca890
commit 2682b811c9
2 changed files with 16 additions and 4 deletions

View file

@ -1245,12 +1245,15 @@ static NSFileManager* defaultManager = nil;
}
else if (c_path[0] == '/')
{
NSDictionary *env;
NSDictionary *env;
NSString *cyghome;
env = [[NSProcessInfo processInfo] environment];
if ([env objectForKey: @"CYGWIN"])
cyghome = [env objectForKey: @"CYGWIN_HOME"];
if (cyghome != nil)
{
/* FIXME: Find cygwin drive? */
newpath = @"c:/cygwin";
newpath = cyghome;
newpath = [newpath stringByAppendingPathComponent: path];
newpath = [newpath stringByReplacingString: @"/" withString: @"\\"];
}

View file

@ -147,7 +147,16 @@ NSHomeDirectoryForUser(NSString *login_name)
s = [NSString stringWithCString: buf];
}
else
s = nil;
{
s = nil;
}
if (s != nil)
{
n = GetEnvironmentVariable("HOMEDRIVE", buf, 1024);
buf[n] = '\0';
s = [[NSString stringWithCString: buf] stringByAppendingString: s];
}
[gnustep_global_lock unlock];
return s;
#endif