`cmd`, so must not free before using `cmd`.
[ruby-core:66648] [Bug #10563]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c (ruby_set_argv): convert argv from UTF-8.
* win32/win32.c (rb_w32_sysinit, cmdglob, w32_cmdvector): convert
wide char command line to UTF-8 argv, and glob in UTF-8 so that
metacharacters would match multibyte characters.
[ruby-dev:48752] [Bug #10555]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (win32_direct_conv, rb_w32_readdir): convert UTF-8
and filesystem code page by using Win32 API directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
is to get rid of the side effect of ENV["TZ"]. then, if ENV["TZ"] is
not set, no need to adjust. this change makes File#stat about 60%
faster.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (init_env): save USER environment variable in
login name if it is set. [ruby-core:66163] [Bug #10493]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
function to support nonblock-mode of pipes.
* win32/win32.c (rb_w32_read): nonblock-mode pipe returns ERROR_NO_DATA
if there is no data, but also returns it if remote-end is closed.
* win32/win32.c (rb_w32_write): if cannot to write any data, it may be
blocking.
* io.c (rb_io_set_nonblock): use rb_w32_set_nonblock for Windows.
* ext/io/nonblock/nonblock.c (rb_io_nonblock_set): use ruby's API when
setting nonblock-mode.
* test/ruby/test_io.rb: test nonblock pipes on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (constat_attr): manage reverse video internally
since Windows console window does not manage it. based on the
patch by white leaf in [ruby-dev:48483]. [Bug #10158]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/file.c (rb_file_expand_path_internal, rb_file_load_ok):
use functions defined in win32/win32.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
hey nobu, why don't you write Changelog for such serious changes?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c: include "missing/nextafter.c" and address
finite() and isnan() macros, to get rid of infinite recursion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (ustatfs): need a linkage to get rid of conflict.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (dln_find_1): use CharNextExA() instead of CharNext()
to respect the given code page.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (NtCmdLineElement): use long instead of int for
rb_w32_wstr_to_mbstr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (rb_w32_sysinit): use WCHAR version of GetCommandLine()
internally.
* win32/win32.c (w32_cmdvector): renamed from rb_w32_cmdvector. use
WCHAR* instead of char* internally.
these changes are expected to not changing the behavior yet.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
reset inherit flag of socket to avoid unintentional inheritance of
socket. note that the return value of SetHandleInformation() is not
verified intentionally because old Windows may return an error.
[Bug #9688] [ruby-core:61754]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/win32.h, win32/win32.c (rb_w32_inet_pton): add a
wrapper function for inet_pton minimum supported client is
Vista, as well as inet_ntop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: let mingw do something black-magic, and check if
_gmtime64_s() is available actually.
* win32/win32.c (gmtime_s, localtime_s): use _gmtime64_s() and
_localtime64_s() if available, not depending on very confusing
mingw variants macros. based on the patch by phasis68 (Heesob
Park) at [ruby-core:58764]. [ruby-core:58391] [Bug #9119]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (console_emulator_p): check by comparison between
module handle of WriteConsoleW and kernel32.dll.
* configure.in, win32/Makefile.sub, win32/setup.mak: no longer need
psapi.lib.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/setup.mak (check-psapi.h): check if psapi.h is available.
* win32/win32.c (CHECK_CONSOLE_EMULATOR): enable console emulator DLL
check only when psapi.h is available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (clock_getres): required as well as clock_gettime().
[ruby-dev:47699] [Bug #8869]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
tv_usec instead of rounding down.
this change is an experiment to get rid of failures on vc10-x64 CI.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (rb_w32_conv_from_wchar): converted string to CP_UTF8
should have UTF-8 encoding. otherwise no conversion takes place
later.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (rb_w32_conv_from_wchar): use WideCharToMultiByte(),
as like as mbstr_to_wstr(), in the first step of the convertion from
WCHAR.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (rb_w32_write_console): use MultiByteToWideChar() for
the last step of conversion to WCHAR, to get rid of warnings from
rb_enc_find() in miniruby. [ruby-dev:47584] [Bug #8733]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (wstr_to_mbstr, mbstr_to_wstr): fix wrong trimming.
WideCharToMultiByte() and MultiByteToWideChar() do not count
NUL-terminator in the size for conversion result, unless the input
length is -1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (rb_w32_pipe): use enum for compile time constants,
instead of const int for debugging.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (rb_w32_pipe): fix pipe name formatting. as "%x" may
not contain '0' at all, fill at fixed position instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e