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

13613 Коммитов

Автор SHA1 Сообщение Дата
akr bf5e559ce0 * transcode.c (declare_transcoder): arguments order changed.
(rb_declare_transcoder): call declare_transcoder just once.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 15:13:37 +00:00
akr ae1b02a8da * include/ruby/encoding.h (rb_econv_t): use rb_econv_option_t.
* transcode.c: follow the rb_econv_t change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:49:36 +00:00
akr 329729da55 * io.c (rb_io_init_copy): copy encs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:40:37 +00:00
akr 98e34b223b rdoc updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:32:59 +00:00
akr 7918141932 * io.c (rb_io_open): add an argument: vperm.
(open_key_args): call rb_io_open with perm.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:18:32 +00:00
akr 6f8c2ea9c4 * io.c (sym_invalid): removed.
(sym_undef): removed.
  (sym_ignore): removed.
  (sym_replace): removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:11:52 +00:00
akr c22f52c06f * io.c (rb_io_reopen): initialize fptr->encs.opts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:07:46 +00:00
akr 071319fde1 * io.c (rb_io_s_pipe): accept optional hash.
(rb_io_set_encoding): ditto.
  (rb_io_extract_modeenc): use rb_econv_opts to initialize
  ecopts.
  (rb_file_open_generic): ditto.
  (rb_file_open_internal): ditto.
  (io_encoding_set): new argument: opt.
  (argf_set_encoding): copy fptr->encs.opts to argf_ecopts.

* transcode.c (rb_econv_opts): accept Qnil for initialization.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 09:40:31 +00:00
akr 571b114708 * include/ruby/io.h (rb_io_enc_t): add opts field.
(FMODE_INVALID_MASK): removed.
  (FMODE_INVALID_IGNORE): ditto.
  (FMODE_INVALID_REPLACE): ditto.
  (FMODE_UNDEF_MASK): ditto.
  (FMODE_UNDEF_IGNORE): ditto.
  (FMODE_UNDEF_REPLACE): ditto.
  (MakeOpenFile): initialize the opts field.

* io.c (make_writeconv): use the opts field.
  (io_fwrite): ditto.
  (make_readconv): ditto.
  (argf_ecopts): new macro.
  (rb_io_extract_modeenc): fill the opts field.
  (argf_next_argv): ditto.
  (rb_file_open_generic): initialize the opts field.
  (rb_file_open_internal): ditto.
  (io_encoding_set): ditto.
  (argf_set_encoding): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 09:13:55 +00:00
akr 6d019ccbd0 * io.c (struct argf): use struct rb_io_enc_t.
(argf_enc): follow the struct argf change.
  (argf_enc2): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 09:03:04 +00:00
akr 09c7eba7b1 * include/ruby/encoding.h (rb_str_transcode): make 3rd argument
rb_econv_option_t*.

* transcode.c (transcode_loop): take rb_econv_option_t* as a argument.
  (str_transcode0): ditto.
  (str_transcode): make rb_econv_option_t and call str_transcode0 with
  it.
  (rb_str_transcode): take rb_econv_option_t*.

* io.c (io_fwrite): follow the rb_str_transcode change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 08:39:09 +00:00
akr d7bf454666 * include/ruby/io.h (rb_io_t): make enc and enc2 as struct
rb_io_enc_t;

* io.c: follow the structure change.
  (convconfig_t): defined by rb_io_enc_t.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 07:49:13 +00:00
akr 1c3d34cad5 add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 07:26:16 +00:00
akr f27b74142e * include/ruby/encoding.h (rb_econv_opts): declared.
* transcode.c (rb_econv_opts): defined.

* io.c (rb_io_extract_modeenc): use rb_econv_opts.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 07:20:21 +00:00
akr 9b8adfed22 * include/ruby/encoding.h (rb_econv_option_t): defined.
(rb_econv_open): 3rd arg changed.
  (rb_econv_open_exc): ditto.

* io.c (make_writeconv): use rb_econv_option_t.
  (make_readconv): ditto.
  (rb_econv_open): take rb_econv_option_t for options.
  (rb_econv_open_exc): ditto.
  (transcode_loop): use rb_econv_option_t.
  (econv_init): use rb_econv_option_t.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 07:12:44 +00:00
akr b47c46106a * transcode.c (rb_econv_substr_append): associate dst with destination
encoding when dst is created.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 06:44:21 +00:00
akr c6d291b003 * include/ruby/encoding.h (rb_str_transcode): add ecflags argument.
* transcode.c (econv_opts): extracted from str_transcode.
  (str_transcode_enc_args): extracted from str_transcode.
  (str_transcode0): extracted from str_transcode.
  (str_transcode): use econv_opts, str_transcode_enc_args,
  str_transcode0.
  (rb_str_transcode): call str_transcode0.
  (econv_primitive_insert_output): give the additional argument for
  rb_str_transcode.

* io.c (make_writeconv): use invalid/undef flags.
  (io_fwrite): ditto.
  (rb_scan_open_args): give the additional argument for
  rb_str_transcode.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 06:25:24 +00:00
akr 51ad3df2ce * transcode.c (str_transcode): check last hash only if 0 < argc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 04:28:12 +00:00
akr bc0efbc9cd * include/ruby/encoding.h (rb_econv_substr_append): renamed from
rb_econv_string.
  (rb_econv_str_convert): declared.
  (rb_econv_substr_convert): declared.
  (rb_econv_str_append): declared.

* io.c (io_fwrite): use rb_econv_str_convert instead of
  rb_econv_string.

* transcode.c (rb_econv_substr_append): renamed from rb_econv_string.
  (rb_econv_str_append): new function.
  (rb_econv_substr_convert): ditto.
  (rb_econv_str_convert): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 03:22:43 +00:00
naruse a65d2e0574 * lib/net/http.rb (Net::HTTP#urlencode): str[0] returns char in 1.9.
Patch by Junegunn Choi [ruby-core:18368]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 03:21:36 +00:00
akr 7c2c7ea315 * transcode.c (rb_econv_open): return NULL on error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 03:03:18 +00:00
akr 8f9ed3c464 * include/ruby/encoding.h (rb_econv_open_exc): declared.
* transcode.c (rb_eNoConverter): new exception.
  (rb_econv_open_exc): new function.
  (transcode_loop): use rb_econv_open_exc.

* io.c (make_writeconv): use rb_econv_open_exc.
  (make_readconv): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 02:42:37 +00:00
naruse 55742dce2d * lib/cgi.rb (CGI::unescapeHTML): consider ISO-8859-1.
[ruby-dev:35936]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 02:27:47 +00:00
naruse 82dc949bba add ref to [ruby-dev:35936].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 02:05:13 +00:00
naruse cc98d3e440 * enc/emacs_mule.c: support Emacs/Mule internal encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 01:58:18 +00:00
nobu e6770d9407 * strftime.c (daylight, timezone): not provied as dllexport on cygwin,
right now.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 23:03:44 +00:00
naruse 29449d70be * lib/cgi.rb (CGI::unescapeHTML): more encoding sensible unescaping.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 21:40:59 +00:00
naruse 33dd0c35f1 * encoding.c (enc_compatible_p): raise TypeError when argument is Encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 21:12:32 +00:00
svn e8e8472058 * 2008-08-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 16:06:52 +00:00
kazu 1b82d027d4 fix typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 16:06:48 +00:00
naruse 9c24ab3d9d * lib/cgi.rb (CGI#out): remove auto encoding conversion and set
LANGUAGE. [ruby-dev:35922]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 14:29:00 +00:00
kazu 8aaf39ce80 * test/ruby/test_process.rb (TestProcess#test_rlimit_value): add Errno::EINVAL. [ruby-dev:35900]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 11:04:54 +00:00
akr cefcbd24f6 * io.c (rb_scan_open_args): use pop_last_hash.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 09:30:06 +00:00
akr 2b78afebc7 * include/ruby/io.h (FMODE_INVALID_MASK): defined.
(FMODE_INVALID_IGNORE): defined.
  (FMODE_INVALID_REPLACE): defined.
  (FMODE_UNDEF_MASK): defined.
  (FMODE_UNDEF_IGNORE): defined.
  (FMODE_UNDEF_REPLACE): defined.

* io.c (sym_invalid): defined.
  (sym_undef): defined.
  (sym_ignore): defined.
  (sym_replace): defined.
  (make_readconv): specify ECONV_INVALID_* and ECONV_UNDEF_* if
  FMODE_INVALID_* and FMODE_UNDEF_* is set.
  (rb_io_extract_modeenc): check {:invalid, :undef} => {:replace,
  :ignore} for FMODE_INVALID_* and FMODE_UNDEF_*.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 08:41:02 +00:00
nobu 5378f8e5b1 * strftime.c (rb_strftime): support more flags.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 08:06:59 +00:00
nobu 74cd315a50 * compile.c (iseq_build_body): suppress a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 07:01:57 +00:00
ko1 400796e87b * vm_opts.h: enable "OPT_TRACE_INSTRUCTION" on default.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 06:18:11 +00:00
akr d4fabf0e36 * include/ruby/encoding.h (ECONV_INVALID_MASK): defined.
(ECONV_INVALID_IGNORE): defined.
  (ECONV_INVALID_REPLACE): defined.
  (ECONV_UNDEF_MASK): defined.
  (ECONV_UNDEF_IGNORE): defined.
  (ECONV_UNDEF_REPLACE): defined.

* transcode.c (INVALID_IGNORE): removed.
  (INVALID_REPLACE): removed.
  (UNDEF_IGNORE): removed.
  (UNDEF_REPLACE): removed.
  (rb_econv_convert0): renamed from rb_econv_convert.
  (rb_econv_convert): defined to call rb_econv_convert0 with
  replace/ignore behavior moved from transcode_loop.
  (transcode_loop): replace/ignore behavior removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 06:02:58 +00:00
akr 860c233103 * io.c (rb_io_extract_modeenc): check :textmode and :binmode in option
hash.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 02:23:42 +00:00
akr 3721df734c * ext/pty/pty.c (pty_getpty): follow rb_io_t's path -> pathv change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 01:49:56 +00:00
akr d2cb86c532 * io.c (check_pipe_command): extracted from rb_f_open and rb_io_open.
(rb_f_open): use check_pipe_command.
  (rb_io_open): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 01:45:49 +00:00
akr 341abd3f88 * io.c (read_all): fptr->enc2 is 0 if no conversion.
(rb_io_getline_fast): ditto.
  (io_getc): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 01:14:33 +00:00
akr 895fd7ec5e * include/ruby/io.h (rb_io_t): remove path field and add pathv field.
(MakeOpenFile): initialize pathv as Qnil.

* gc.c: mark pathv field in T_FILE.

* io.c: follow the rb_io_t field change.

* file.c: ditto.

* ext/socket/socket.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 00:47:54 +00:00
svn 1c44355be9 * 2008-08-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 16:44:04 +00:00
akr c0d3881e0e * include/ruby/io.h (FMODE_TEXTMODE): defined.
* include/ruby/encoding.h (rb_econv_t): new field: flags.
  (rb_econv_binmode): declared.

* io.c (io_unread): text mode hack removed.
  (NEED_NEWLINE_DECODER): defined.
  (NEED_NEWLINE_ENCODER): defined.
  (NEED_READCONV): defined.
  (NEED_WRITECONV): defined.
  (TEXTMODE_NEWLINE_ENCODER): defined for windows.
  (make_writeconv): setup converter with TEXTMODE_NEWLINE_ENCODER for
  text mode.
  (io_fwrite): use NEED_WRITECONV.  character code conversion is
  disabled if fptr->writeconv_stateless is nil.
  (make_readconv): setup converter with
  ECONV_UNIVERSAL_NEWLINE_DECODER for text mode.
  (read_all): use NEED_READCONV.
  (appendline): use NEED_READCONV.
  (rb_io_getline_1): use NEED_READCONV.
  (io_getc): use NEED_READCONV.
  (rb_io_ungetc): use NEED_READCONV.
  (rb_io_binmode): OS-level text mode test removed.  call
  rb_econv_binmode.
  (rb_io_binmode_m): call rb_io_binmode_m with write_io as well.
  (rb_io_flags_mode): return mode string including "t".
  (rb_io_mode_flags): detect "t" for text mode.
  (rb_sysopen): always specify O_BINARY.

* transcode.c (rb_econv_open_by_transcoder_entries): initialize flags.
  (rb_econv_open): if source and destination encoding is
  both empty string, open newline converter.  last_tc will be NULL in
  this case.
  (rb_econv_encoding_to_insert_output): last_tc may be NULL now.
  (rb_econv_string): ditto.
  (output_replacement_character): ditto.
  (transcode_loop): ditto.
  (econv_init): ditto.
  (econv_inspect): ditto.
  (rb_econv_binmode): new function.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 16:44:00 +00:00
tadf 0dd677da4e typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 14:05:53 +00:00
tadf 8f40b26581 * complex.c (nucomp_div): now behaves as quo.
* complex.c (nucomp_s_generic_p): has been removed.

	* complex.c (nucomp_to_s): adopts new form.

	* complex.c (nucomp_inspect): ditto.

	* complex.c (string_to_c_internal): ditto and supports polar form.

	* complex.c (rb_complex_polar): new.

	* rational.c (nurat_to_s): did not canonicalize.
	
	* rational.c (nurat_inspect): adopts new form.
	
	* rational.c (string_to_r_internal): ditto.

	* include/ruby/intern.h: added a declaration.

	* lib/complex.rb: added an obsolate class method.

	* lib/cmath.rb: use scalar? instead of generic?.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 12:27:54 +00:00
kazu 2d302dfd40 * lib/webrick/server.rb (WEBrick::GenericServer#shutdown):
rescue Errno::ENOTCONN and close. [ruby-dev:35896]

* test/openssl/test_ssl.rb (OpenSSL#start_server): ditto.
  [ruby-dev:35897]

* lib/net/imap.rb (Net::IMAP#disconnect): ditto. [ruby-dev:35898]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 11:12:06 +00:00
tadf 122595c263 * lib/date.rb: no need to require the "lib/rational.rb" any more.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 11:00:05 +00:00
tadf 1acc8f9483 revert
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 10:55:48 +00:00