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:
Richard Frith-Macdonald 2002-05-07 11:06:22 +00:00
parent ff202496f3
commit 1db427f190
3 changed files with 41 additions and 13 deletions

View file

@ -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;
}
/**