diff --git a/Source/NSFileManager.m b/Source/NSFileManager.m index d4bd49a1c..a84183b55 100644 --- a/Source/NSFileManager.m +++ b/Source/NSFileManager.m @@ -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: @"\\"]; } diff --git a/Source/NSUser.m b/Source/NSUser.m index caac42959..b03d8ed16 100644 --- a/Source/NSUser.m +++ b/Source/NSUser.m @@ -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