mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* hash.c (getenv): use ANSI codepage version of getenv() for miniruby
on Windows. [ruby-core:58732] [Bug #9189] reported by phasis68 (Heesob Park). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
547bd873d3
commit
6b1a58b9e6
2 changed files with 17 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Dec 2 00:53:01 2013 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* hash.c (getenv): use ANSI codepage version of getenv() for miniruby
|
||||
on Windows.
|
||||
[ruby-core:58732] [Bug #9189] reported by phasis68 (Heesob Park).
|
||||
|
||||
Sun Dec 1 22:14:27 2013 Zachary Scott <e@zzak.io>
|
||||
|
||||
* doc/contributors.rdoc: [DOC] Import contributors from redmine wiki
|
||||
|
|
12
hash.c
12
hash.c
|
@ -2423,7 +2423,17 @@ static char **my_environ;
|
|||
#undef environ
|
||||
#define environ my_environ
|
||||
#undef getenv
|
||||
#define getenv(n) rb_w32_ugetenv(n)
|
||||
inline char *
|
||||
getenv(const char *name)
|
||||
{
|
||||
static int binary = -1;
|
||||
static int locale = -1;
|
||||
if (binary < 0) {
|
||||
binary = rb_ascii8bit_encindex();
|
||||
locale = rb_locale_encindex();
|
||||
}
|
||||
return locale == binary ? rb_w32_getenv(name) : rb_w32_ugetenv(name);
|
||||
}
|
||||
#elif defined(__APPLE__)
|
||||
#undef environ
|
||||
#define environ (*_NSGetEnviron())
|
||||
|
|
Loading…
Reference in a new issue