1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

28 commits

Author SHA1 Message Date
matz
919f456de8 * exception message clean-up by Ian Macdonald <ian@caliban.org>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-29 07:54:38 +00:00
akr
745ce54b4a * ext/stringio/stringio.c (strio_sysread): StringIO.new.sysread didn't
raise EOFError.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-28 11:27:42 +00:00
nobu
6fe8d987ce * ext/stringio/stringio.c (strio_read): clear the buffer argument
when returning nil.  [ruby-dev:22363]

* test/ruby/ut_eof.rb (TestEOF::test_eof_0, TestEOF::test_eof_1):
  add buffer argument tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-24 05:23:32 +00:00
nobu
c2b63d249f * ext/stringio/stringio.c (strio_read): never return nil at
unlimited read.  [ruby-dev:22334]

* ext/stringio/stringio.c (strio_read): support second
  argument.  [ruby-dev:22350]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-24 01:29:57 +00:00
nobu
c5d4ee4a39 * ext/stringio/stringio.c (strio_read): set EOF flag at short read.
[ruby-dev:22223], [ruby-dev:22224]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-10 10:29:00 +00:00
nobu
ba18b0c6cb * ext/stringio/stringio.c (strio_read): do not set EOF flag when
requested length is zero.  [ruby-dev:22214]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-10 08:54:56 +00:00
nobu
6395c3b38d * ext/stringio/stringio.c (strio_read): adjust behavior at reading
beyond EOF to IO.  [ruby-dev:22205]

* test/ruby/ut_eof.rb (TestEOF::Seek): test behaviors at reading
  beyond EOF.

* test/ruby/test_file.rb, * test/stringio/test_stringio.rb:
  include TestEOF::Seek test case.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-10 08:16:14 +00:00
nobu
7fbf13f7f2 * ext/stringio/stringio.c (strio_read): follow IO#read.
* test/ruby/ut_eof.rb, test/ruby/test_file.rb, test/ruby/test_pipe.rb,
  test/stringio/test_stringio.rb: add EOF test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-05 02:54:48 +00:00
nobu
0c15b3a222 * test/stringio/test_stringio.rb: imported from [ruby-dev:21941].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-18 09:23:07 +00:00
nobu
12eee69294 * ext/stringio/stringio.c (strio_read): behave as IO at empty string.
[ruby-dev:21939]

* ext/stringio/stringio.c (strio_getc, strio_getline): set EOF flag.

* ext/stringio/stringio.c (strio_rewind, strio_seek, strio_ungetc):
  clear EOF flag.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-18 09:09:41 +00:00
nobu
4646ba6b2a * ext/stringio/stringio.c (strio_set_string, strio_reopen): check
tainted.

* ext/stringio/stringio.c (strio_copy, strio_ungetc, strio_write,
  strio_putc): add infection.

* ext/stringio/stringio.c (strio_path): just nil.  [ruby-dev:21846]

* ruby.c (proc_options): reserve searched script path in the
  source file name table.  [ruby-list:38765]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-06 01:17:59 +00:00
matz
4699b4afbb * eval.c (rb_thread_atfork): wrong format specifier.
[ruby-dev:21428]

* process.c (pst_inspect): better description.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-29 02:44:49 +00:00
matz
dea1baa169 * ext/stringio/stringio.c (strio_gets): only "gets" should set $_.
* ext/stringio/stringio.c (strio_getline): should not set $_ here.

* io.c (argf_to_s): argf.to_s returns "ARGF".

* io.c (set_defout_var, set_deferr_var): make $defout and $deferr
  obsolete.

* io.c (set_input_var, set_output_var): allow $stdin, $stdout,
  $stderr not to be instance of IO.

* io.c (rb_f_readline): forward method to current_file. gets,
  readline, readlines, getc, readchar, tell, seek, pos=, rewind,
  fileno, to_io, eof, each_line, each_byte, binmode, and closed?
  as well.

* io.c (argf_forward): utility function to forward method to
  current_file.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-28 07:31:52 +00:00
nobu
7a1482c3ee * ext/stringio/stringio.c: includes Enumerable as well as IO.
[ruby-talk:77058]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-26 05:14:17 +00:00
matz
7406260aed * eval.c (rb_disable_super, rb_enable_super): deprecate.
* eval.c (thgroup_s_alloc): re-implement group struct.

* eval.c (thgroup_add): add check for enclose and frozen status.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-16 07:11:30 +00:00
michal
4e13d36561 -Wall cleanups (removed unused vars, no 'code has no effect' warnings)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-16 07:38:40 +00:00
nobu
3780ede6ef * ext/curses/curses.c, ext/digest/digest.c, ext/dl/handle.c,
ext/dl/ptr.c, ext/dl/sym.c, ext/gdbm/gdbm.c, ext/iconv/iconv.c,
  ext/stringio/stringio.c, ext/strscan/strscan.c,
  ext/tcltklib/tcltklib.c, ext/win32ole/win32ole.c:
  use rb_define_alloc_func().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-20 11:23:40 +00:00
nobu
1b19c063b8 * ext/digest/digest.c (rb_digest_base_copy): renamed "become".
* ext/stringio/stringio.c (strio_copy): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-11 02:31:59 +00:00
nobu
23fb79a290 * ext/stringio/stringio.c (strio_set_string): reinitialize
properly.

* ext/stringio/stringio.c (strio_become): added self-assign check
  and experimental auto-conversion to StringIO.

* ext/stringio/stringio.c (strio_reopen): added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-09 02:27:01 +00:00
matz
6f484e4930 * variable.c (rb_copy_generic_ivar): remove old generic instance
variable table if it existes.

	* class.c (rb_make_metaclass): metaclass of a metaclass is a
	  metaclass itself.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-03 05:20:14 +00:00
nobu
343f505fb8 * ext/stringio/stringio.c (strio_initialize): RSTRING(mode)->ptr
can be NULL.

* ext/stringio/stringio.c (strio_ungetc): fix buffer overflow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-28 10:14:06 +00:00
nobu
a9efb02c18 * ext/stringio/stringio.c (strio_gets_internal): fixed for record
separator longer than 1.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-11 15:04:23 +00:00
nobu
b596fbbc37 * ext/stringio/stringio.c (strio_mark): must check if ptr is NULL
first.  [ruby-talk:38873]

* lib/mkmf.rb (create_makefile): should print depend file when
  make is other than nmake.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-23 16:22:25 +00:00
nobu
e223518948 * ext/stringio/stringio.c (check_modifiable): performance
improvement.  avoid calling rb_str_modify() twice.

* ext/stringio/stringio.c (strio_ungetc): ditto.

* ext/stringio/stringio.c (strio_putc): ditto.

* ext/stringio/stringio.c (strio_write): ditto, and use
  rb_str_cat() as possible.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-09 03:52:39 +00:00
nobu
7632b48a7d * ext/stringio/stringio.c (check_modifiable): wrong declaration.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-18 13:21:01 +00:00
nobu
7dc66370cb * eval.c (rb_f_abort): should not bypass cleanup.
* ext/stringio/stringio.c (check_modifiable): void function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-18 08:21:40 +00:00
nobu
4f0870f74b * ext/stringio/stringio.c: fixed frozen string bug. ungetc no
longer raises on readonly stream unless modifies actually.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-14 03:35:52 +00:00
nobu
7435953055 Initial revision
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-11 11:58:07 +00:00