Commit graph

177 commits

Author SHA1 Message Date
knu
2b785b0f3e Merge changes from ruby_1_8 to reduce warnings and potentially improve
security.

* mkconfig.rb: hide build path from rbconfig.rb.

* util.c (ruby_strtod, dtoa): initialize more variables for error
  handling.

* io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique),
  (path2class, path2module): constified.

* pack.c (pack_unpack), process.c (rb_syswait): suppress warnings.

* suppress warnings on cygwin, mingw and mswin.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06 10:39:57 +00:00
knu
8480bcc8d5 Merge -r16241:16456 from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-18 15:02:36 +00:00
nobu
1c411796ef * win32/win32.c (rb_w32_cmdvector): terminate shrunken command line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-11 07:43:55 +00:00
nobu
6cb19dcbd9 * win32/win32.c (rb_w32_map_errno): exported.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-20 14:55:21 +00:00
nobu
0ced605434 * win32/win32.c (rb_w32_open_osfhandle): reverted to old definition.
[ ruby-Bugs-16948 ]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-10 01:53:52 +00:00
usa
1901ca6a17 * win32/win32.c (make_cmdvector): adjust escaped successive
double-quote handling. (merge from trunk)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-02 12:21:03 +00:00
usa
b5aaf376b0 * win32/win32.c (init_env): initialize HOME and USER environment
variables unless set. [ruby-core:12328] (merge from trunk)

	* win32/win32.c (NtInitialize, getlogin): ditto.

	* configure.in, win32/Makefile.sub (LIBS): need to link shell32
	  library for SH* functions on mswin32 and mingw32.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-02 12:18:35 +00:00
nobu
521da028b5 * bcc32/{Makefile.sub,configure.bat,setup.mak: configure_args
support.

* bcc32/setup.mak: check runtime version.

* win32/win32.c (rb_w32_open_osfhandle): prototype has changed
  in bcc 5.82.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-21 08:32:34 +00:00
nobu
f298a1a670 * ext/digest/digest.c (rb_digest_instance_update,
rb_digest_instance_finish, rb_digest_instance_reset,
  rb_digest_instance_block_length): %s in rb_raise() expects char*.
  [ruby-dev:31222]

* ext/openssl/ossl.h: include ossl_pkcs5.h.  [ruby-dev:31231]

* ext/openssl/ossl_pkcs5.h: new file for PKCS5.  [ruby-dev:31231]

* ext/openssl/ossl_x509name.c (ossl_x509name_to_s): use ossl_raise()
  instead of rb_raise().  [ruby-dev:31222]

* ext/sdbm/_sdbm.c: DOSISH platforms need io.h.  [ruby-dev:31232]

* ext/syck/syck.h: include stdlib.h for malloc() and free().
  [ruby-dev:31232]

* ext/syck/syck.h (syck_parser_set_input_type): prototype added.
  [ruby-dev:31231]

* win32/win32.c: include mbstring.h for _mbspbrk().  [ruby-dev:31232]

* win32.h (rb_w32_getcwd): prototype added.  [ruby-dev:31232]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-15 13:24:51 +00:00
nobu
5e862d6692 * win32/win32.c (CreateChild): enclose command line except for
command.com which can not handle quotes.  [ruby-talk:258939]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 06:02:18 +00:00
nobu
84e3af3885 * win32/win32.c (rb_w32_opendir): store attributes of the second
entries or later too.

* win32/win32.c (rb_w32_opendir, rb_w32_readdir): eliminate magic
  numbers.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-29 01:59:45 +00:00
nobu
ff964e8aa2 * win32/win32.c (move_to_next_entry): loc also must move forward.
[ruby-talk:251987]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-18 08:09:21 +00:00
usa
7f8f2a33d1 * win32/win32.c (init_stdhandle): stderr should be without buffering,
but mswin32 use buffering when stderr is not connected to tty.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-15 05:55:06 +00:00
usa
edac529177 * thread_win32.ci (w32_wait_events): check whether interrupt_event is
valid handle or not.

	* thread_win32.ci (native_thread_destroy): clear interrupt_event when
	  close it.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-10 08:37:21 +00:00
usa
0dded0986d * win32/win32.c (set_pioinfo_extra): new function for VC++8 SP1
workaround. [ruby-core:10259]

* win32/win32.c (NtInitialize): call above function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-23 06:11:14 +00:00
usa
ae2370fb50 * signal.c (sighandler): need to tell to be interrupted to main
context when handler is installed.

* win32/win32.[ch] (rb_win32_interrupted): new function to listen
  interrupt.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-23 05:23:02 +00:00
knu
af44ff5ea8 * dir.c, win32/win32.c, win32/dir.h, ruby.h, intern.h: Bring
encoding aware globbing support in from trunk.  Dir.[] and
  Dir.glob() can now take many patterns in an array.  Minor fixes
  will follow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-15 02:52:43 +00:00
nobu
d630684687 * dir.c (glob_helper): get rid of possible memory leak.
* win32/win32.c (cmdglob, rb_w32_cmdvector, rb_w32_opendir,
  rb_w32_get_environ): not to use GC before initialization.
  [ruby-core:09024]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-30 14:23:46 +00:00
nobu
f4735faa34 * win32/win32.c (rb_w32_utime): allow NULL to set the current time.
[ruby-talk:219248]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-18 14:03:43 +00:00
nobu
05bc15b0ec * win32/win32.c (init_stdhandle): assign standard file handles.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-01 08:44:44 +00:00
usa
eec1f2882e * win32/win32.c (exit_handler): new function; release winsock and
environment work area.

* win32/win32.c (NTInitialize): setup exit_handler.

* win32/win32.c (StartSockets): use exit_handler.
  exit handler.

* win32/win32.c (rb_w32_getenv): use GetEnvironmentStrings() instead
  of GetEnvironmentVariable(), because the latter cannot distinguish
  wheather a null environment variable exists or not.
  fixed: [ruby-talk:205123]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-31 08:09:01 +00:00
usa
45b085a0b2 * win32/win32.c (open_ifs_socket): should not use plain malloc.
* win32/win32.c (rb_w32_opendir): should not use plain realloc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-18 14:13:07 +00:00
usa
c52019ffe7 * win32/win32.[ch] (rb_w32_send, rb_w32_sendto): constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-26 00:57:31 +00:00
usa
98f09b9618 * win32/win32.[ch] (rb_w32_read, rb_w32_write): new functions.
use recv() and send() when fd is socket. fixed: [ruby-dev:28694]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-08 05:20:00 +00:00
usa
1ea51f02ec * win32/win32.c (errmap): add some winsock errors.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-07 05:53:46 +00:00
usa
4e19b0e00f * win32/{configure.bat, setup.mak, Makefile.sub, win32.h}: add
support new configure option `--with-winsock2'.

* win32/win32.c (StartSockets): ditto.

* ext/socket/extconf.rb: ditto.

* win32/win32.c (open_ifs_socket): new function.

* win32/win32.c (StartSockets, rb_w32_socket): use open_ifs_socket()
  instead of socket().
  ifs socket support is backported from trunk.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-07 01:51:47 +00:00
nobu
ae6dedc7f0 * win32/win32.c (rb_w32_cmdvector): backslashes inside single-quotes
no longer has special meanings.  fixed: [ruby-list:42311]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-01 10:13:41 +00:00
usa
02821cc038 * win32/win32.c (rb_w32_getcwd): runtime's getcwd() will not success
if the length of the cwd is longer than MAX_PATH.
  fixed [ruby-list:42335]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-01 07:18:12 +00:00
usa
ee39e2578a * win32/win32.c (rb_w32_getcwd): set errno if not set.
fixed [ruby-list:42346]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-01 02:34:30 +00:00
ocean
8bd7f1ecc5 * win32/win32.c (filetime_to_unixtime): should set tm_isdst to -1.
stat() didn't treat daylight saving time property on WinNT.
  [ruby-talk:182100]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-03-02 04:01:31 +00:00
usa
d23d055d47 * time.c (time_new_internal): add prototype to tell the compiler
arugments types.

* win32/win32.c (NtInitialize): need to set a handler for VC++8.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-24 02:22:33 +00:00
usa
4b7ecb15d1 * time.c (search_time_t): support non 32bit time_t environments.
* win32/Makefile.sub (config.h): VC++8 has ``long long'' type.

* win32/Makefile.sub (config.h): VC++8's time_t is 64bit value.

* win32/win32.c (rb_w32_utime): drop read-only attribute before
  changing file time.

  all changes are backported from CVS HEAD.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-14 05:03:16 +00:00
usa
49a2b019f6 * win32/win32.c (LK_ERR): ERROR_NOT_LOCKED is not an error.
In such situation, flock() should return 0.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-04 12:21:55 +00:00
usa
b12d498a0a * win32/win32.c (ioinfo): revert previous commit. sorry.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-06 02:27:33 +00:00
usa
4f092ec3d0 * win32/win32.c (ioinfo): VC++8 support, forgotten to commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-05 10:05:08 +00:00
ocean
73a71e19c8 * win32/win32.c (rb_w32_seekdir): should not segfault even if passed
the location which rb_w32_telldir didn't return. [ruby-core:7035]

* test/ruby/test_dir.rb: added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-01 08:12:39 +00:00
usa
34664e81af * file.c (eaccess): workaround for VC++8 runtime.
* win32/win32.c (ioinfo): VC++8 support.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-29 19:55:58 +00:00
ocean
67ea4d0242 * win32/win32.c (rb_w32_strerror): remove all CR and LF. (avoid broken
error message on bccwin32 + winsock)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-28 04:24:26 +00:00
nobu
fff3548e04 * file.c (test_identical): test if two files are identical.
* file.c (rb_f_test): support DOSISH systems where st_ino is not
  reliable.  fixed: [ruby-core:06672]

* win32.h, win32.c (rb_w32_osid): check the running platform.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-22 16:26:39 +00:00
ocean
4dc782978d * win32/win32.c (winnt_stat): set mapped errno instead of ENOENT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-22 09:42:09 +00:00
ocean
bb935564fd * win32/win32.c (rb_w32_stat): Dir.chdir('//server/shared');
p Dir.glob('*') should work on WinNT. (implemented our own
  stat(2) on WinNT) [ruby-list:41552] [ruby-dev:27711]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-22 04:21:01 +00:00
usa
45e155dbe5 * win32/win32.c (ioctl): should set errno.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-14 13:09:11 +00:00
nobu
14e256f4b1 * dir.c (ruby_glob): glob function not using ruby exception system.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 13:41:02 +00:00
ocean
4d11a486ae * win32/win32.c: just uniformed method style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-08-05 04:19:22 +00:00
ocean
0661db665e * win32/win32.c (rb_w32_strerror): should return correct message
for ENAMETOOLONG and ENOTEMPTY. (bcc32) [ruby-dev:26533]

* win32/win32.c (rb_w32_strerror): stripped CR LF on the tail.
  (bcc32) [ruby-dev:26533]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-14 09:33:52 +00:00
ocean
d20bc9f4d2 * win32/win32.c (rb_w32_mkdir): should set EEXIST (not EACCES)
if file or directory already exists. (bcc32)

* win32/win32.c (rb_w32_rmdir): should set ENOTDIR (not EINVAL)
  if it is not directory. (bcc32, win32)

* win32/win32.c (rb_w32_rmdir, rb_w32_unlink): restore
  FILE_ATTRIBUTE_READONLY flag on function failure.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-13 10:40:06 +00:00
usa
8f8d7c1113 * ext/dbm/dbm.c (fdbm_closed): new method DBM#closed?
* ext/gdbm/gdbm.c (fgdbm_closed): new method GDBM#closed?

* ext/sdbm/init.c (fsdbm_closed): new method SDBM#closed?

* test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb, test/sdbm/test_sdbm.rb
  (teardown): close all db objects before deleting data files.

* win32/win32.{ch} (unlink): hook runtime function to change
  file attribute before unlinking.
  fixed: [ruby-dev:26360]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-20 07:53:22 +00:00
nobu
a5f61654e9 * dir.c (glob_helper): get rid of using String. [ruby-dev:26180]
* dir.c (push_braces): should skip balanced braces.

* eval.c (ruby_options), win32/win32.c (NtInitialize): move argument
  intialization back.  [ruby-dev:26180]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-18 14:39:27 +00:00
usa
3279381758 * win32/win32.c (unixtime_to_filetime): use localtime() instaed of
gmtime() when using FileLocalTimeToFileTime().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-17 02:52:43 +00:00
ocean
49e9468085 * win32/win32.{h,c}: define rb_{p,g,u}id_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-15 23:53:17 +00:00