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

659 Коммитов

Автор SHA1 Сообщение Дата
nobu 2c4d43082c win32.c: cursor relative to screen
* win32/win32.c (constat_apply): move relative to visible screen,
  not the entire buffer.  [ruby-core:81883] [Bug #13707]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-03 10:22:15 +00:00
nobu ff5e3b98a0 win32.c: rb_dir_getwd_ospath
* win32/win32.c (rb_dir_getwd_ospath): Windows implementation
  moved from dir.c.  get rid of freeing malloced memory by xfree.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-12 00:18:30 +00:00
nobu cb85a5316f win32.c: no locale
* win32/win32.c (skipspace, w32_cmdvector): get rid of iswspace(),
  which is locale dependent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-05 07:26:15 +00:00
nobu 000482a173 rb_w32_ugetcwd: UTF-8 version getcwd
* dir.c (rb_dir_getwd): convert from UTF-8.

* win32/win32.c (w32_getcwd): codepage aware getcwd using
  GetCurrentDirectoryW.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16 10:25:56 +00:00
nobu 3d718d2119 disable critical-error-handler
* win32/win32.c (rb_w32_sysinit): disable critical-error-handler
  message box even on mswin, regardless of runtime DLL version.
  [ruby-dev:49988] [Bug #13254]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-28 04:33:15 +00:00
nobu 9019934c64 win32.c: memcpy instead of strlcpy
* win32/win32.c (cmdglob): memcpy the exact size instead of
  strlcpy with +1.

* win32/win32.c (w32_cmdvector): ditto, with NUL-terminating.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-16 02:47:21 +00:00
usa de59178aaf * win32/win32.c (winnt_stat): use `numberof` macro instead of constant.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-21 08:13:42 +00:00
usa 5d6ace6121 Fixed potentially buffer overrun.
* win32/win32.c (winnt_stat): the return value of `get_final_path` is the
  expected buffer length, not the actuall filled length.

* win32/win32.c (winnt_stat): `finalname` may be accessed in the outer block of
  its definition via `path`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-21 07:50:14 +00:00
nobu 9db0b2d7ee win32.c: suppress warning
* win32/win32.c (rb_w32_home_dir): suppress sequence-point
  warning, REALLOC_N re-assigns the variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-07 03:19:33 +00:00
nobu 58742627af win32.c: special folders as home dir
* win32/win32.c (rb_w32_home_dir): move from win32/file.c to try
  special folders.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-26 11:37:01 +00:00
usa c82d87444b * win32/win32.c (poll_child_status): rb_w32_wait_events_blocking() sets
errno internally, then should not set it here.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-30 17:03:48 +00:00
usa ee0a79b37f * win32/win32.c (rb_w32_write_console): should set writen length as the
return value.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-11 10:08:01 +00:00
nobu 70d840afd5 win32/file.h: rb_w32_filecp
* win32/file.h (rb_w32_filecp): add declaration.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-25 02:11:19 +00:00
nobu 51d30645a2 win32.c: no newline for rb_fatal
* win32/win32.c (StartSockets): rb_fatal does not need a newline
  at the end.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-20 02:19:19 +00:00
nobu 743c279d70 win32.c: initialize with an impossible value
* win32/win32.c (getifaddrs, rb_w32_getppid): initialize the API
  pointers with an impossible value not to try everytime on old
  platforms.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-05 08:31:23 +00:00
nobu 518af61ba6 win32.c: static API pointers
* win32/win32.c (rb_w32_inet_ntop, rb_w32_inet_): make the
  API pointers static not to get the address everytime.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-05 08:28:03 +00:00
nobu bd46ad2195 win32.c: call get_final_path pointer
* win32/win32.c (get_final_path): initialize this pointer without
  further comparisons.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-05 08:22:35 +00:00
usa 441cbf59f5 * win32/win32.c (set_pioinfo_extra): use more reliable way to search
the position of pioinfo of VC14, and also support debug library of it.
  patched by davispuh AT gmail.com
  [ruby-core:76644] [Bug #12644]
  this fixes also [Bug #12631]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-01 19:12:28 +00:00
nobu a325876ad3 Fix Issues reported by PVS-Studio static analyzer
* vm.c (vm_set_main_stack): remove unnecessary check.  toplevel
  binding must be initialized.  [Bug #12611] (N1)
* win32/win32.c (w32_symlink): fix return type.  [Bug #12611] (N3)
* string.c (rb_str_split_m): simplify the condition.
  [Bug #12611](N4)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-22 10:55:22 +00:00
nobu 8361dab9cb VC6 error
* win32/win32.c (GetSystemWindowsDirectoryW): use
  GetWindowsDirectoryW for VC6.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-29 04:37:14 +00:00
nobu 6e6a8c02af Fix calling convention
* win32/win32.c (get_special_folder): fix calling convention of
  SHGetPathFromIDListEx, which should be WINAPI.  pointed out by
  @arton at http://twitter.com/arton/status/744884064277016576

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-20 15:56:49 +00:00
nobu 5820c6a3ce win32.c: use PATH_MAX
* win32/win32.c: unify MAX_PATH, _MAX_PATH, and MAXPATHLEN to
  PATH_MAX, except for MAX_PATH in get_special_folder for an API
  limit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-04 01:38:41 +00:00
nobu f0ead75ff1 win32.c: fail before getting ITEMIDLIST
* win32/win32.c (get_special_folder): fail before getting
  ITEMIDLIST if the buffer is less than 260 word which
  SHGetPathFromIDListW requires.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-03 13:38:27 +00:00
usa b30bbc38fc * win32/win32.c (get_special_folder): typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-03 08:52:03 +00:00
nobu 0661411671 win32.c: use SHGetPathFromIDListEx
* win32/win32.c (get_special_folder): use SHGetPathFromIDListEx if
  available instead of old SHGetPathFromIDListW, to check the
  buffer size.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-02 12:18:12 +00:00
nobu 0d123232e5 win32.c: RUBY_CRITICAL
* win32/win32.c (RUBY_CRITICAL): removed the argument but make
  just a block which does nothing, so that debuggers can step into
  the block.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-29 04:10:28 +00:00
usa 3e5dc499a8 * win32/win32.c, include/ruby/win32.h (rb_w32_utruncate): implements new
truncate alternative which accepts UTF-8 path.

* file.c (truncate): use above function.
  [Bug #12340]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-02 14:05:19 +00:00
usa 54916154a0 * win32/win32.c: drop Win2K support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01 12:00:35 +00:00
usa 62b6e90d58 * cont.c, hash.c, random.c, win32/win32.c: cleanup some Win9x/ME/NT4
support leftovers.
  [fix GH-1328] patched by @cremno


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01 11:42:41 +00:00
nobu f9602ee315 win32/win32.c: remove unnecessary declaration
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-29 00:56:44 +00:00
nobu cc0ffc5517 win32.c: suppress warnings
* win32/win32.c (set_pioinfo_extra): remove "/*" within comment.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-24 01:10:29 +00:00
naruse 9afc312b4f Support MSVC14 and 15 [Bug #11118]
Search _pioinfo which is not exported after MSVC14.
[Bug #12014] [GH-884]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-23 18:46:26 +00:00
nobu a3239b5bec win32.c: call w32_wopen directly
* win32/win32.c (rb_w32_uopen): call w32_wopen directly instead of
  variadic rb_w32_wopen.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-07 12:14:29 +00:00
usa 96e0b7d45f * win32/win32.c (rb_w32_write_console): remove unused variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-08 23:00:32 +00:00
usa b0b2df253f * win32/win32.c (rb_w32_write_console): now no need to check
ERROR_CALL_NOT_IMPLEMENTED because it is for old Win9X.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-08 08:34:35 +00:00
usa 693b335326 * win32/win32.c (rb_w32_write_console): stop the VT100 emulation if the
console supports it natively.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-08 07:55:48 +00:00
nobu eee616315d win32.c: reuse fullpath buffer
* win32/win32.c (open_dir_handle): reuse the fullpath buffer
  instead of allocating another buffer for copy.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-02 05:43:44 +00:00
nobu 0f19e79b87 win32.c: w32_wopendir
* win32/win32.c (w32_wopendir): remove filename parameter, and
  check the drive letter in wpath instead.  rename from
  opendir_internal.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-01 15:06:17 +00:00
nobu 94cfa2893c win32.c: volume_prefix_len
* win32/win32.c (rb_w32_read_reparse_point): name the prefix
  length to be dropped.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-01 12:08:08 +00:00
nobu 19162d268b win32.c: suffix should be alnum
* win32/win32.c (fileattr_to_unixmode): built-in executable
  suffixes are alpha-numeric only, no needs to scan whole path,
  especially path separators.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-01 08:14:03 +00:00
nobu 1664a4ca03 win32.c: move counting length
* win32/win32.c (opendir_internal): defer counting the length just
  before the loop where it is used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-01 06:25:21 +00:00
nobu ec943ac668 win32/file.c: drop garbage
* win32/file.c (rb_readlink): drop garbage after the substitute
  name, as rb_w32_read_reparse_point returns the expected buffer
  size but "\??\" prefix is dropped from the result.
* win32/win32.c (w32_readlink): ditto, including NUL-terminator.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29 08:41:10 +00:00
usa 47f6196cf0 * win32/win32.c (fileattr_to_unixmode, rb_w32_reparse_symlink_p): volume
mount point should be treated as directory, not symlink.
  [ruby-core:72483] [Bug #11874]

* win32/win32.c (rb_w32_read_reparse_point): check the reparse point is
  a volume mount point or not.

* win32/file.c (rb_readlink): follow above change (but this pass won't
  be used).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29 08:13:42 +00:00
nobu 9fcfaa8da4 win32.c: fix argument type
* win32/win32.c (dupfd): promote argument type for old VC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-01 04:25:06 +00:00
usa 2e865ba81e * win32/win32.c (finish_overlapped_socket): return value of this
function should be only 0 or SOCKET_ERROR.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-19 05:16:13 +00:00
usa 01a54cf40f * win32/win32.c (finish_overlapped_socket): ignore EMSGSIZE when input,
because POSIX platforms just do so.  fixes test errors revealed by
  r52647.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-19 04:59:50 +00:00
usa 508addd7e0 * win32/win32.c (fstat): declare for mingw.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17 10:50:28 +00:00
nobu f213f5044e win32.c: fallback to WCHAR-version in MSVCRT
* win32/win32.c (rb_w32_open): should not fallback to ANSI-version
  in MSVCRT, fallback to WCHAR-version in rb_w32_wopen instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-22 11:59:47 +00:00
nobu 70b2af3b21 win32.c: no xmalloc at sys_init
* win32/win32.c (rb_w32_sysinit, rb_w32_readdir): compare by
  encoding index to get rid of encoding initialization before VM
  object space allocation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-15 06:15:44 +00:00
nobu 9c9d555e7f win32.c: encindex.h
* win32/win32.c: needs encindex.h for encoding indexes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-15 06:03:37 +00:00