зеркало из https://github.com/github/ruby.git
* win32/win32.c (init_env): refactoring. remove unused code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
77a6c82eab
Коммит
50c7751b60
|
@ -1,3 +1,7 @@
|
|||
Tue Oct 2 20:16:55 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* win32/win32.c (init_env): refactoring. remove unused code.
|
||||
|
||||
Tue Oct 2 12:30:40 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* array.c (rb_ary_product): generalized product, now takes
|
||||
|
|
|
@ -372,19 +372,16 @@ init_env(void)
|
|||
SetEnvironmentVariable("HOME", env);
|
||||
}
|
||||
}
|
||||
if (GetEnvironmentVariable("USER", env, sizeof env)) {
|
||||
len = strlen(env);
|
||||
}
|
||||
if (GetEnvironmentVariable("USERNAME", env, sizeof env)) {
|
||||
len = strlen(env);
|
||||
SetEnvironmentVariable("USER", env);
|
||||
}
|
||||
else if (GetUserName(env, (len = sizeof env, &len))) {
|
||||
SetEnvironmentVariable("USER", env);
|
||||
}
|
||||
else {
|
||||
NTLoginName = "<Unknown>";
|
||||
return;
|
||||
|
||||
if (!GetEnvironmentVariable("USER", env, sizeof env)) {
|
||||
if (GetEnvironmentVariable("USERNAME", env, sizeof env) ||
|
||||
GetUserName(env, (len = sizeof env, &len))) {
|
||||
SetEnvironmentVariable("USER", env);
|
||||
}
|
||||
else {
|
||||
NTLoginName = "<Unknown>";
|
||||
return;
|
||||
}
|
||||
}
|
||||
NTLoginName = strdup(env);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче