mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Don't permit spaces in USERPROFILE
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15147 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d70630d4ed
commit
98524d8d1c
1 changed files with 14 additions and 0 deletions
|
@ -261,6 +261,20 @@ NSHomeDirectoryForUser(NSString *loginName)
|
|||
/* The environment variable USERPROFILE holds the home directory
|
||||
for the user on more modern versions of windoze. */
|
||||
s = GSStringFromWin32EnvironmentVariable("USERPROFILE");
|
||||
if (s != nil)
|
||||
{
|
||||
const char *str = [s cString];
|
||||
|
||||
while (*str != '\0')
|
||||
{
|
||||
if (isspace(*str))
|
||||
{
|
||||
s = nil; // Whitespace not permitted in USERPROFILE
|
||||
break;
|
||||
}
|
||||
str++;
|
||||
}
|
||||
}
|
||||
if (s == nil)
|
||||
{
|
||||
/* The environment variable HOMEPATH holds the home directory
|
||||
|
|
Loading…
Reference in a new issue