mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
mingw tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13603 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ff202496f3
commit
1db427f190
3 changed files with 41 additions and 13 deletions
|
@ -144,9 +144,9 @@ NSUserName(void)
|
|||
char buf[1024];
|
||||
DWORD n = 1024;
|
||||
|
||||
if (GetEnvironmentVariable("LOGNAME", buf, 1024))
|
||||
if (GetEnvironmentVariable("LOGNAME", buf, 1024) != 0 && buf[0] != '\0')
|
||||
loginName = buf;
|
||||
else if (GetUserName(buf, &n))
|
||||
else if (GetUserName(buf, &n) != 0 && buf[0] != '\0')
|
||||
loginName = buf;
|
||||
#else
|
||||
loginName = getenv("LOGNAME");
|
||||
|
@ -268,8 +268,15 @@ NSHomeDirectoryForUser(NSString *loginName)
|
|||
}
|
||||
[gnustep_global_lock unlock];
|
||||
}
|
||||
if ([s length] == 0 && [loginName length] != 1)
|
||||
{
|
||||
s = nil;
|
||||
NSLog(@"NSHomeDirectoryForUser(%@) failed", loginName);
|
||||
}
|
||||
#endif
|
||||
return ImportPath(s, 0);
|
||||
s = ImportPath(s, 0);
|
||||
// NSLog(@"Home for %@ is %@", loginName, s);
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue