summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* fix preivous change.akr2008-08-181-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_open_file): don't access argv[-1] by akr2008-08-182-8/+15
| | | | | | | File.allocate.instance_eval { initialize }. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_inspect): don't raise for uninitialized Regexp.akr2008-08-183-2/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2008-08-19svn2008-08-181-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_check_readable): side effect for STDIN removed.akr2008-08-183-6/+24
| | | | | | | (rb_io_external_encoding): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_ungetbyte): renamed from io_ungetc.akr2008-08-183-15/+88
| | | | | | | | (rb_io_ungetbyte): new method. (rb_io_ungetc): push back into character buffer if enc2 is set. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (id_encode): removed.akr2008-08-182-2/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (make_writeconv): if enc and enc2 is set, convertakr2008-08-183-24/+25
| | | | | | | | | | string.encoding to enc2. * include/ruby/io.h: comment changed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): new fields: writeconv,akr2008-08-187-17/+297
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writeconv_stateless and writeconv_initialized. (MakeOpenFile): initialize them. * include/ruby/encoding.h (rb_econv_stateless_encoding): declared. (rb_econv_string): declared. * io.c (make_writeconv): new function. (io_fwrite): use econv. (make_readconv): fix error message. (finish_writeconv): new function. (fptr_finalize): call finish_writeconv. (clear_writeconv): new function. (clear_codeconv): new function to call both clear_readconv and clear_writeconv. (rb_io_fptr_finalize): call clear_codeconv instead of clear_readconv. (mode_enc): ditto. (io_set_encoding): ditto. (argf_next_argv): ditto. (io_encoding_set): ditto. * gc.c (gc_mark_children): mark writeconv_stateless in T_FILE. * transcode.c (stateless_encoding_i): new function. (rb_econv_stateless_encoding): ditto. (rb_econv_string): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (clear_readconv): extracted from rb_io_fptr_finalize.akr2008-08-183-8/+77
| | | | | | | | | | (mode_enc): call clear_readconv. (io_set_encoding): ditto. (argf_next_argv): ditto. (io_encoding_set): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update comment.akr2008-08-181-2/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (mode_enc): modify enc and enc2 consistently.akr2008-08-182-1/+14
| | | | | | | | (io_set_encoding): ditto. (io_encoding_set): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (transcode_search_path): prevent infinite loop byakr2008-08-182-0/+8
| | | | | | | searching a path for self conversion. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_enc_str): code conversion removed.akr2008-08-182-20/+8
| | | | | | | | (io_enc_str_converted): removed because it is identical to io_enc_str now. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_shift_crbuf): add strp argument to append into existingakr2008-08-183-101/+209
| | | | | | | | | string. (read_all): use econv if enc2 is set. (io_getc): follow the io_shift_crbuf change. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_enc_str_converted): new function.akr2008-08-183-57/+163
| | | | | | | | | | | | | (make_readconv): extracted from io_getc. (more_char): ditto. (appendline): use econv via make_readconv and more_char for code conversion. (prepare_getline_args): don't convert record separator. (rb_io_getline_1): don't use rb_io_getline_fast if enc2 is set. (io_getc): use make_readconv and more_char. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add tests.akr2008-08-181-5/+19
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk: fix error in uncommon.mk.kazu2008-08-172-1/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk: config.h depends config.status.naruse2008-08-172-0/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (appendline): appendline cannot check character boundary.akr2008-08-173-54/+49
| | | | | | | (rb_io_getline_1): relax limit until character boundary. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2008-08-18svn2008-08-171-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/cgi.rb (WEBrick::CGI::Socket#eof?): added lacked method.gotoyuzo2008-08-173-3/+34
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (prepare_getline_args): io.gets(10,nil) should cause TypeError.akr2008-08-173-20/+27
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mkmf.rb: not check config.h.nobu2008-08-172-3/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mkmf.rb (init_mkmf): add include/ruby/backward to $INCFLAGS.nobu2008-08-174-1/+22
| | | | | | | | * include/ruby/backward/{st,util}.h: added for backward compatibility. [ruby-dev:35811] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2008-08-171-21/+21
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_primitive_putback): new method.akr2008-08-173-0/+40
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_putbackable): declared.akr2008-08-175-1/+44
| | | | | | | | | | | | | (rb_econv_putback): ditto. * transcode.c (rb_econv_putbackable): implemented. (rb_econv_putback): ditto. * io.c (io_getc): put back bytes if possible. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (make_econv_exception): add several instance variablesakr2008-08-173-7/+88
| | | | | | | | | | | | | | | | | to exception object. (ecerr_source_encoding): new method: Encoding::ConversionUndefined#source_encoding and Encoding::InvalidByteSequence#source_encoding. (ecerr_destination_encoding): new method: Encoding::ConversionUndefined#destination_encoding and Encoding::InvalidByteSequence#destination_encoding. (econverr_error_char): new method: Encoding::ConversionUndefined#error_char. (econverr_error_bytes): new method: Encoding::ConversionUndefined#error_bytes. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * random.c (struct MT): packed Mersenne Twister staffs.nobu2008-08-172-81/+94
| | | | | | | * random.c (struct RandSeed): packed random seed staffs. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/iconv/test_option.rb (test_ignore_option): skip if iconvnaruse2008-08-162-0/+9
| | | | | | | | doesn't have transliterate. * test/iconv/test_option.rb (test_translit_option): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): new fields: readconv, crbuf, crbuf_off,akr2008-08-164-10/+105
| | | | | | | | | | | | | crbuf_len, crbuf_capa. (MakeOpenFile): initialize them. * io.c (io_shift_crbuf): new function. (io_getc): use econv. (rb_io_fptr_finalize): finalize readconv and crbuf. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2008-08-17svn2008-08-161-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_check_error): declared.akr2008-08-163-5/+58
| | | | | | | | | * transcode.c (make_econv_exception): new function. (transcode_loop): use make_econv_exception. (rb_econv_check_error): defined. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ChangeLog: stripped trailing spaces.nobu2008-08-161-47/+47
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * id.c (Init_id): commit miss.nobu2008-08-161-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_elem_t): fields removed: from andakr2008-08-163-6/+27
| | | | | | | | | | | | | | | to. (rb_econv_t): new fields: source_encoding_name and destination_encoding_name. * transcode.c (rb_econv_open_by_transcoder_entries): initialize the new fields. (rb_econv_open): set up the new fields. (econv_inspect): use the new fields. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_t): add fields: in_buf_start,akr2008-08-165-244/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in_data_start, in_data_end, in_buf_end and last_trans_index. (rb_econv_output): removed. (rb_econv_insert_output): declared. (rb_econv_encoding_to_insert_output): declared. * enc/trans/newline.trans (rb_universal_newline): stateful_type changed. * transcode.c (transcode_restartable0): initialize inchar_start, tc->recognized_len and next_table at beginning of the loop. (rb_econv_open_by_transcoder_entries): initialize new fields. (rb_econv_open): setup last_trans_index. (trans_sweep): last out_buf_start can be non-NULL now. (rb_econv_convert): check last out_buf_start and in_buf_start at first. (rb_econv_output_with_destination_encoding): removed. (econv_just_convert): removed. (rb_econv_output): removed. (econv_primitive_output): method removed. (rb_econv_encoding_to_insert_output): new function. (allocate_converted_string): new function. (rb_econv_insert_output): new function. (econv_primitive_insert_output): new method. (output_replacement_character): use rb_econv_insert_output. unused arguments removed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu2008-08-1622-6/+35
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: commit miss.nobu2008-08-161-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (SSIZET2NUM, NUM2SSIZET, SSIZE_MAX, SSIZE_MIN):nobu2008-08-152-0/+25
| | | | | | | macros for ssize_t. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode_data.h (rb_transcoder_stateful_type_t): defined.akr2008-08-156-0/+36
| | | | | | | | | | | | | | | | | (rb_transcoder): add field: stateful_type. * tool/transcode-tblgen.rb: generate stateful_type field as stateless_converter. * enc/trans/iso2022.trans: follow rb_transcoder change. * enc/trans/newline.trans: ditto. * enc/trans/utf_16_32.trans: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2008-08-16svn2008-08-151-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add a test.akr2008-08-151-0/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_just_convert): extracted from rb_econv_output.akr2008-08-153-38/+177
| | | | | | | | (rb_econv_output): use econv_just_convert. (econv_primitive_output): new method. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_output): add str_encodingakr2008-08-153-8/+105
| | | | | | | | | | | | | | | argument. * transcode.c (get_replacement_character): add repl_enc_ptr argument. (rb_econv_output_with_destination_encoding): renamed from rb_econv_output and make it static. (rb_econv_output): convert str and call rb_econv_output_with_destination_encoding. (output_replacement_character): follow above interface change. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_drop_bytes): use memmove.nobu2008-08-152-1/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_t): add error_tc in last_error.akr2008-08-153-5/+14
| | | | | | | | * transcode.c (rb_econv_convert): fill error_tc. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_t): new field: last_error.akr2008-08-154-16/+218
| | | | | | | | | | | * transcode.c (rb_trans_conv): new argument: result_position_ptr. (rb_econv_convert): fill last_error. (econv_result_to_symbol): extracted from econv_primitive_convert. (econv_primitive_errinfo): new method. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk (parse.{c,h}): creates in the dependency order.nobu2008-08-152-2/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e