mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Fix for home directory on windoze
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15142 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
92963d25d1
commit
ec82855b5b
2 changed files with 14 additions and 6 deletions
|
@ -257,14 +257,20 @@ NSHomeDirectoryForUser(NSString *loginName)
|
|||
#else
|
||||
if ([loginName isEqual: NSUserName()] == YES)
|
||||
{
|
||||
/* Then environment variable HOMEPATH holds the home directory
|
||||
for the user on Windows NT; Win95 has no concept of home. */
|
||||
[gnustep_global_lock lock];
|
||||
s = GSStringFromWin32EnvironmentVariable("HOMEPATH");
|
||||
if (s != nil)
|
||||
/* The environment variable USERPROFILE holds the home directory
|
||||
for the user on more modern versions of windoze. */
|
||||
s = GSStringFromWin32EnvironmentVariable("USERPROFILE");
|
||||
if (s == nil)
|
||||
{
|
||||
s = [GSStringFromWin32EnvironmentVariable("HOMEDRIVE")
|
||||
stringByAppendingString: s];
|
||||
/* The environment variable HOMEPATH holds the home directory
|
||||
for the user on Windows NT; Win95 has no concept of home. */
|
||||
s = GSStringFromWin32EnvironmentVariable("HOMEPATH");
|
||||
if (s != nil)
|
||||
{
|
||||
s = [GSStringFromWin32EnvironmentVariable("HOMEDRIVE")
|
||||
stringByAppendingString: s];
|
||||
}
|
||||
}
|
||||
[gnustep_global_lock unlock];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue