mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* win32/win32.c (init_env): use _wputenv() instead of
SetEnvironmentVariableW() because latter doesn't set msvcrt's environ work area, of course. [Bug #2552] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
37ce3f6e0d
commit
4301bbbe0f
2 changed files with 17 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Tue Jan 12 14:53:07 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* win32/win32.c (init_env): use _wputenv() instead of
|
||||||
|
SetEnvironmentVariableW() because latter doesn't set msvcrt's environ
|
||||||
|
work area, of course.
|
||||||
|
[Bug #2552]
|
||||||
|
|
||||||
Tue Jan 12 13:33:54 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
Tue Jan 12 13:33:54 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* file.c (realpath_rec): trace symbolic link only when supporting
|
* file.c (realpath_rec): trace symbolic link only when supporting
|
||||||
|
|
|
@ -435,6 +435,7 @@ init_env(void)
|
||||||
{
|
{
|
||||||
static const WCHAR TMPDIR[] = L"TMPDIR";
|
static const WCHAR TMPDIR[] = L"TMPDIR";
|
||||||
WCHAR env[_MAX_PATH];
|
WCHAR env[_MAX_PATH];
|
||||||
|
WCHAR *buf;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
BOOL f;
|
BOOL f;
|
||||||
|
|
||||||
|
@ -458,7 +459,9 @@ init_env(void)
|
||||||
}
|
}
|
||||||
if (f) {
|
if (f) {
|
||||||
regulate_path(env);
|
regulate_path(env);
|
||||||
SetEnvironmentVariableW(L"HOME", env);
|
buf = ALLOCA_N(WCHAR, 5 + lstrlenW(env) + 1);
|
||||||
|
wsprintfW(buf, L"HOME=%s", env);
|
||||||
|
_wputenv(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,7 +471,9 @@ init_env(void)
|
||||||
NTLoginName = "<Unknown>";
|
NTLoginName = "<Unknown>";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SetEnvironmentVariableW(L"USER", env);
|
buf = ALLOCA_N(WCHAR, 5 + lstrlenW(env) + 1);
|
||||||
|
wsprintfW(buf, L"USER=%s", env);
|
||||||
|
_wputenv(buf);
|
||||||
}
|
}
|
||||||
NTLoginName = strdup(rb_w32_getenv("USER"));
|
NTLoginName = strdup(rb_w32_getenv("USER"));
|
||||||
|
|
||||||
|
@ -482,7 +487,9 @@ init_env(void)
|
||||||
if (*(p - 1) != L'/') *p++ = L'/';
|
if (*(p - 1) != L'/') *p++ = L'/';
|
||||||
if (p - env + numberof(temp) < numberof(env)) {
|
if (p - env + numberof(temp) < numberof(env)) {
|
||||||
memcpy(p, temp, sizeof(temp));
|
memcpy(p, temp, sizeof(temp));
|
||||||
SetEnvironmentVariableW(TMPDIR, env);
|
buf = ALLOCA_N(WCHAR, lstrlenW(TMPDIR) + 1 + lstrlenW(env) + 1);
|
||||||
|
wsprintfW(buf, L"%s=%s", TMPDIR, env);
|
||||||
|
_wputenv(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue