Граф коммитов

545 Коммитов

Автор SHA1 Сообщение Дата
nobu fa13cb050d win32: suppress warnings
* win32/file.c (home_dir, code_page_i): parenthesize to suppress
  warnings.

* win32/win32.c (is_command_com, join_argv, w32_cmdvector, kill),
  (constat_attr_color_reverse, constat_attr): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-24 10:18:35 +00:00
usa 396e3da75d * win32/win32.c (w32_spawn): `v2` is used not only for `shell` but also
`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
2014-12-03 02:16:42 +00:00
nobu 33ea2646b9 win32.c: use UTF-8 for argv
* 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
2014-11-29 07:53:17 +00:00
nobu a35a256bad win32.c: convert by Win32 API
* 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
2014-11-29 01:49:26 +00:00
nobu 2e7ed8032d win32.c: for non-standard console
* win32/win32.c (constat_reset): do nothing on non-standard
  console emurators.  [ruby-core:66471] [Bug #10546]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-26 10:54:35 +00:00
usa 56d8b8701d * win32/win32.c (rb_w32_write): should set the error of
GetOverlappedResult()'s, not WriteFile()'s (it's always
  ERROR_IO_PENDING, of course).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-18 22:46:13 +00:00
usa e9885185c4 * rb_w32_fstat{,i64}: speed up. adjuting timestamps in this function
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
2014-11-13 03:18:00 +00:00
nobu 0d70c707ae win32.c: user name
* 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
2014-11-10 14:24:53 +00:00
usa 1b0cbb6ae0 * win32/win32.c (rb_w32_read): retry with reduced length if cannot to
write any data but no error occurs.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10 11:21:42 +00:00
usa fd9f6bde95 * win32/win32.c, include/win32/win32.h (rb_w32_set_nonblock): new
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
2014-11-10 10:42:19 +00:00
nobu 6ccf3d68c2 win32.c: login name encoding
* ext/etc/etc.c (etc_getlogin): set login name encoding properly.
  [ruby-core:66163] [Bug #10493]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10 08:24:36 +00:00
nobu ccbeb0d6dc * win32/win32.c (cmdglob): use inline function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-23 13:32:32 +00:00
nobu 43b00d8a11 win32.c: manage reverse video
* 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
2014-08-21 08:10:34 +00:00
nobu b136c5cd48 win32/file.c: share functions with win32.c
* 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
2014-08-09 10:10:11 +00:00
nobu 4a26246beb win32.c: unused variable
* win32/win32.c (envarea): remove no longer used variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-23 22:16:19 +00:00
usa 25e8bfce58 * win32/win32.c (rb_w32_conv_from_wchar): follow nobu's previous commit.
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
2014-06-02 22:35:17 +00:00
naruse 210f863906 revert File::Statfs [Feature #9772]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-22 10:39:48 +00:00
nobu 3360dfd294 win32.c: fix infinite recursion
* 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
2014-05-18 13:20:39 +00:00
nobu f7397d988a win32.c: add linkage
* 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
2014-04-30 16:45:32 +00:00
nobu d681a6247b win32.c: declare for old VC
* win32/win32.c (ustatfs): declare GetVolumePathNameW for old VC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-30 16:07:02 +00:00
usa 86dc863bd8 * win32/win32.c, include/ruby/win32.h (ustatfs): implementation of
statfs(2) clone. [EXPERIMENTAL]

* file.c (rb_io_statfs): use above function.

* configure.in, win32/Makefile.sub (struct statfs): available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-22 15:45:00 +00:00
nobu 9f4f9048a0 win32.c: CharNextExA with cp
* 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
2014-04-16 02:46:53 +00:00
nobu 7d66f95523 win32.c: adjust type
* 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
2014-04-15 16:23:07 +00:00
usa 1242292de9 * include/ruby/win32.h (rb_w32_cmdvector): removed.
* 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
2014-04-15 10:39:36 +00:00
nobu ac4e60bfb2 win32.c: wchar conversion
* win32/win32.c (rb_w32_wstr_to_mbstr, rb_w32_mbstr_to_wstr): make
  WCHAR/mb conversion functions public.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-05 23:51:27 +00:00
usa 38c3ba2fa5 * win32/win32.c (rb_w32_accept, open_ifs_socket, socketpair_internal):
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
2014-03-30 14:42:52 +00:00
nobu 1b81dafdd5 win32/win32.c: add rb_w32_inet_pton
* 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
2014-02-23 02:54:04 +00:00
nobu 58a7cdaaf0 win32/win32.c: mingw jungle
* 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
2013-12-25 04:00:59 +00:00
nobu 21f81885ab win32.c: rb_w32_dup2
* win32/win32.c (rb_w32_dup2): extract from rb_cloexec_dup2() and
  redirect_dup2().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-28 07:15:56 +00:00
nobu d66c5768ca win32.c: check by module handles
* 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
2013-10-17 08:11:21 +00:00
nobu a8c6a52a1a win32/setup.mak: check psapi.h
* 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
2013-10-16 13:50:29 +00:00
nobu d63f9e933c win32.c: bail out if no memory
* win32/win32.c (rb_w32_write_console): bail out when buffer
  allocation failed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-10 06:33:38 +00:00
nobu 72db853bb8 win32.c: internal functions
* win32/win32.c (w32_spawn, w32_aspawn_flags): make internal functions
  static.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07 05:03:29 +00:00
nobu 886e3bb1df win32.c: disable console colorizing
* win32/win32.c (console_emulator_p, constat_handle): disable built-in
  console colorizing when console-emulator-like DLL is injected.
  [Feature #8201]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-03 09:20:51 +00:00
nobu 59baeaf10f win32.c: clock_getres
* win32/win32.c (clock_getres): remove unused variable.
  [ruby-dev:47699] [Bug #8869]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-06 05:36:23 +00:00
nobu f245f0c664 win32.c: clock_getres
* 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
2013-09-06 05:23:28 +00:00
nobu 88270e7773 win32.c: suppress warning
* win32/win32.c (do_select): unconstify timeout as select() declares
  it non-const.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-04 14:41:38 +00:00
usa 736f97b278 * win32/win32.c (rb_w32_select_with_thread): rounding up the fraction of
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
2013-09-03 02:28:14 +00:00
usa 61ce3f5744 * win32/win32.c (do_select): constify timeout.
* win32/win32.c (rb_w32_select_with_thread): constify 10ms wait and
  0ms wait structs.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 02:02:05 +00:00
usa 5a096eddb3 * include/ruby/win32.h (CLOCK_MONOTONIC): typo.
* win32/win32.c: removed duplicated declarations.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-19 04:29:41 +00:00
usa f653019d55 * win32/win32.c (clock_gettime): improve precision when freq is less
than and nearly equals 10**9.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-15 09:41:40 +00:00
usa 866cee6162 * include/ruby/win32.h, win32/Makefile.sub, win32/win32.c
(clock_gettime): [experimental] emulates clock_gettime(2) of posix.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-15 05:32:02 +00:00
nobu b0391268a2 win32.c: fix conversion
* 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
2013-08-06 08:42:25 +00:00
nobu 8ea8dfd88c win32.c: conversion from WCHAR
* 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
2013-08-06 08:02:20 +00:00
nobu 42bd951087 win32.c: supprss warning
* win32/win32.c (rb_w32_system_tmpdir): supprss a sign-compare
  warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-06 05:12:48 +00:00
nobu 8d564597fa win32.c: conversion to WCHAR
* 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
2013-08-05 08:38:39 +00:00
nobu 0f6cd1bb10 win32.c: fix wrong trimming
* 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
2013-08-05 08:33:22 +00:00
nobu da8406f0ac win32.c: use enum
* 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
2013-07-28 21:54:34 +00:00
nobu 56150eba92 win32.c: fix pipe name formatting
* 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
2013-07-28 01:54:30 +00:00
nobu 3c9e6f1e62 win32.c: fix infinite recursion
* win32/win32.c (rb_w32_pow): undef pow to get rid of infinite
  recursive call.  re-fix [Bug #8495].  [ruby-core:55923] [Bug #8621]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-11 12:30:24 +00:00