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

56 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada b2d96abb42 Extract version number from the source
"requiring version.rb" strategy has some issues.

- cannot work when cross-compiling
- often introduces wrong namespace
- must know the superclasses
- costs at each runtime than at build-time

etc.
2020-07-30 19:03:18 +09:00
Jeremy Evans 80b5a0ff2a
Make rb_scan_args handle keywords more similar to Ruby methods (#2460)
Cfuncs that use rb_scan_args with the : entry suffer similar keyword
argument separation issues that Ruby methods suffer if the cfuncs
accept optional or variable arguments.

This makes the following changes to : handling.

* Treats as **kw, prompting keyword argument separation warnings
  if called with a positional hash.

* Do not look for an option hash if empty keywords are provided.
  For backwards compatibility, treat an empty keyword splat as a empty
  mandatory positional hash argument, but emit a a warning, as this
  behavior will be removed in Ruby 3.  The argument number check
  needs to be moved lower so it can correctly handle an empty
  positional argument being added.

* If the last argument is nil and it is necessary to treat it as an option
  hash in order to make sure all arguments are processed, continue to
  treat the last argument as the option hash. Emit a warning in this case,
  as this behavior will be removed in Ruby 3.

* If splitting the keyword hash into two hashes, issue a warning, as we
  will not be splitting hashes in Ruby 3.

* If the keyword argument is required to fill a mandatory positional
  argument, continue to do so, but emit a warning as this behavior will
  be going away in Ruby 3.

* If keyword arguments are provided and the last argument is not a hash,
  that indicates something wrong. This can happen if a cfunc is calling
  rb_scan_args multiple times, and providing arguments that were not
  passed to it from Ruby.  Callers need to switch to the new
  rb_scan_args_kw function, which allows passing of whether keywords
  were provided.

This commit fixes all warnings caused by the changes above.

It switches some function calls to *_kw versions with appropriate
kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS
is used.  If creating new arguments, RB_PASS_KEYWORDS is used if
the last argument is a hash to be treated as keywords.

In open_key_args in io.c, use rb_scan_args_kw.
In this case, the arguments provided come from another C
function, not Ruby.  The last argument may or may not be a hash,
so we can't set keyword argument mode.  However, if it is a
hash, we don't want to warn when treating it as keywords.

In Ruby files, make sure to appropriately use keyword splats
or literal keywords when calling Cfuncs that now issue keyword
argument separation warnings through rb_scan_args.  Also, make
sure not to pass nil in place of an option hash.

Work around Kernel#warn warnings due to problems in the Rubygems
override of the method.  There is an open pull request to fix
these issues in Rubygems, but part of the Rubygems tests for
their override fail on ruby-head due to rb_scan_args not
recognizing empty keyword splats, which this commit fixes.

Implementation wise, adding rb_scan_args_kw is kind of a pain,
because rb_scan_args takes a variable number of arguments.
In order to not duplicate all the code, the function internals need
to be split into two functions taking a va_list, and to avoid passing
in a ton of arguments, a single struct argument is used to handle
the variables previously local to the function.
2019-09-25 11:18:49 -07:00
kazu 2a9dd6b818 lib/pstore.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-17 12:47:38 +00:00
normal f845a9ef76 lib/*: remove closed checks
Follow r56795.  Since Ruby 2.2, calling #close on a closed
socket no longer raises exceptions.

* lib/cgi/session.rb (update): remove closed? check
* lib/net/http.rb (finish, transport_request): ditto
* lib/net/imap.rb (disconnect): ditto
* lib/net/pop.rb (do_start, do_finish): ditto
* lib/net/smtp.rb (do_start, do_finish): ditto
* lib/open3.rb (popen_run, pipeline_run): ditto
* lib/pstore.rb (transaction): ditto
* lib/shell/process-controller.rb (sfork):
* lib/tempfile (_close, call, Tempfile.create): ditto
* lib/webrick/httpauth/htdigest.rb (flush): ditto
* lib/webrick/httpauth/htpasswd.rb (flush): ditto
* lib/webrick/server.rb (start_thread, cleanup_shutdown_pipe): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-21 23:05:41 +00:00
kazu 2eb0ad76e1 checksum algorithm is not MD5 only [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-29 12:08:30 +00:00
nobu 9f9add3eb5 PStore: select checksum algorithm
* lib/pstore.rb (PStore::CHECKSUM_ALGO): find available hashing
  algorithm for checksum.  MD5 is not available in FIPS mode.
  [Feature #6943]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-28 14:14:21 +00:00
nobu 4b298ad77a Use qualified names
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-30 06:22:30 +00:00
nobu c9df0f82b7 PStore::CHECKSUM_ALGO
* lib/pstore.rb (PStore::CHECKSUM_ALGO): extract the algorithm for
  checksum, instead of qualified names for each times.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-28 13:55:02 +00:00
a_matsuda 3a05da1321 [DOC] Fix typos
* benchmark.rb
* getoptlong.rb
* irb.rb
* net/http.rb
* net/http/header.rb
* net/imap.rb
* optparse.rb
* pstore.rb
* webrick.rb
* xmlrpc.rb

[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23 03:43:23 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
When you change this to true, you may need to add more tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00
hsbt e32e0a2d3d * lib/pstore.rb: split executable code into sample directory.
* sample/pstore.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-23 19:31:18 +00:00
glass fc4b6cd25f * lib/pstore.rb (PStore): fix not to replace ThreadError raised in
#transaction block with PStore::Error.
  [ruby-core:39238] [Bug #5269]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-11 04:23:04 +00:00
nahi a934aeb619 Cosmetic changes of lib/pstore.rb. Patch by Masaki Matsushita. See #5248.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-20 14:57:29 +00:00
nahi fcec6b5c0d * PStore content update perf optimization. Patch by Masaki Matsushita.
See #5248.

* lib/pstore.rb (save_data):

  * Delete inadequate Marshal check.

  * Deferred file truncation: when writing the new content, truncate
    the saved file to the data size after writing the data, instead of
    truncating whole bytes before writing data.

  * Deferred MD5 calculation: when comparing MD5 hash to check the
    content modification, calculate MD5 hash of new data iif the
    content length is differ from the old one.

  * Compare content size with String#bytesize instead of String#size.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-20 14:56:07 +00:00
ktsj c3749b6a6d * ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,
ext/tk/sample/demos-en/widget, lib/benchmark.rb, lib/irb/cmd/fork.rb,
  lib/mkmf.rb, lib/net/ftp.rb, lib/net/smtp.rb, lib/open3.rb,
  lib/pstore.rb, lib/rexml/element.rb, lib/rexml/light/node.rb,
  lib/rinda/tuplespace.rb, lib/rss/maker/base.rb,
  lib/rss/maker/entry.rb, lib/scanf.rb, lib/set.rb, lib/shell.rb,
  lib/shell/command-processor.rb, lib/shell/process-controller.rb,
  lib/shell/system-command.rb, lib/uri/common.rb: remove unused block
  arguments to avoid creating Proc objects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05 07:37:47 +00:00
nobu 4e7c8bbe03 * lib/pstore.rb, test/test_pstore.rb: suppress warnings with -v.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-13 11:21:52 +00:00
nobu f7081431f2 * lib/pstore.rb (PStore): always open in binary mode even if
default encodings are set.  [Bug #5311] [ruby-core:39503]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-13 06:02:59 +00:00
sorah 6ef956ab90 * lib/pstore.rb: Fix don't raise "nested transaction" when thread_safe
is true. Patch by Masaki Matsushita (Glass_saga). [ruby-dev:43337]

* test/test_pstore.rb: Test for above.
  Patch by Masaki Matsushita (Glass_saga) [ruby-dev:43337]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-13 07:14:07 +00:00
sorah e267617f3e * lib/pstore.rb: Delete variable @transaction and fix #4474. Patch by
Masaki Matsushita (Glass_saga).

* test/test_pstore.rb(test_thread_safe): Add test for #4474.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07 14:03:41 +00:00
akr 9dbffb49fa * lib/pstore.rb (PStore#initialize): initialize @thread_safe.
[ruby-core:27853]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-15 14:09:19 +00:00
nobu aaf53ad5b8 * lib/pstore.rb (PStore#on_windows): fixed typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-13 00:33:06 +00:00
nobu 287a34ae0d * {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06 03:56:38 +00:00
nobu d238b7c627 * lib/pstore.rb (PStore#transaction): return the result from the
block.  [ruby-core:17718]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-10 13:06:03 +00:00
matz e6c1752137 * lib/rdoc.rb: massive spelling correction patch from Evan Farrar
<evanfarrar at gmail.com> in [ruby-doc:1382] applied.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-04 09:37:38 +00:00
matz 3f03878309 * lib/yaml/store.rb (YAML::load): modified to support empty
database.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-11 07:43:31 +00:00
matz 1e8ec51e8f * lib/pstore.rb (PStore::dump, PStore::load): allow subclass
overriding.  [ruby-dev:34305]

* lib/yaml/store.rb (YAML::Store::marshal_dump_supports_canonical_option?): 
  add a method to support faster PStore.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-10 14:10:19 +00:00
matz 1d63f4eead * lib/pstore.rb: replaced by Hongli Lai's faster version.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-10 07:12:41 +00:00
nobu fbe8d44d5c * lib/pstore.rb: open all in binary mode, and get rid of the quirk of
msvcrt.  fixed: [ruby-dev:29518]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-08 19:56:37 +00:00
ocean 4f4ea9db28 * lib/pstore.rb: should return default value if name is not found.
[ruby-core:7304]

* lib/pstore.rb: should raise PStore::Error if not in transaction.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-05 05:28:11 +00:00
matz 9974cb96d3 * eval.c (rb_call_super): should call method_missing if super is
called from Kernel method.

* eval.c (exec_under): frame during eval should preserve external
  information.

* configure.in: use proper option for Sun linker. A patch from
  Shinya Kuwamura <kuwa@labs.fujitsu.com>.  [ruby-dev:27603]

* numeric.c (fix_rshift): RDoc fix.  [ruby-core:6351]

* util.h (strtod): add #undef for platforms defines strtod()
  macro.   [ruby-dev:27563]

* ext/etc/etc.c: document update from mathew <meta@pobox.com>.
  [ruby-core:06473]

* ext/fcntl/fcntl.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-01 13:04:35 +00:00
matz c6b9f16231 * string.c (scan_once): wrong condition to use mbclen2().
[ruby-dev:27535]

* time.c (time_sunday): added predicate methods for the days of the
  week.  [ruby-list:41340]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-27 08:18:38 +00:00
matz 70bbad3cfd * array.c: replace rb_protect_inspect() and rb_inspecting_p() by
rb_exec_recursive() in eval.c.

* eval.c (rb_exec_recursive): new function.

* array.c (rb_ary_join): use rb_exec_recursive().

* array.c (rb_ary_inspect, rb_ary_hash): ditto.

* file.c (rb_file_join): ditto.

* hash.c (rb_hash_inspect, rb_hash_to_s, rb_hash_hash): ditto.

* io.c (rb_io_puts): ditto.

* object.c (rb_obj_inspect): ditto

* struct.c (rb_struct_inspect): ditto.

* lib/set.rb (SortedSet::setup): a hack to shut up warning.
  [ruby-talk:132866]

* lib/time.rb (Time::strptime): add new function.  inspired by
  [ruby-talk:132815].

* lib/parsedate.rb (ParseDate::strptime): ditto.

* regparse.c: move st_*_strend() functions from st.c.  fixed some
  potential memory leaks.

* exception error messages updated.  [ruby-core:04497]

* ext/socket/socket.c (Init_socket): add bunch of Socket
  constants.  Patch from Sam Roberts <sroberts@uniserve.com>.
  [ruby-core:04409]

* array.c (rb_ary_s_create): no need for negative argc check.
  [ruby-core:04463]

* array.c (rb_ary_unshift_m): ditto.

* lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass
  of StandardError class, not Exception class.  [ruby-core:04429]

* parse.y (fcall_gen): lvar(arg) will be evaluated as
  lvar.call(arg) when lvar is a defined local variable. [new]

* object.c (rb_class_initialize): call inherited method before
  calling initializing block.

* eval.c (rb_thread_start_1): initialize newly pushed frame.

* lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE.
  fixed: [ruby-core:04444]

* eval.c (is_defined): NODE_IASGN is an assignment.

* ext/readline/readline.c (Readline.readline): use rl_outstream
  and rl_instream.  [ruby-dev:25699]

* ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check
  [ruby-dev:25675]

* misc/ruby-mode.el: [ruby-core:04415]

* lib/rdoc/generators/html_generator.rb: [ruby-core:04412]

* lib/rdoc/generators/ri_generator.rb: ditto.

* struct.c (make_struct): fixed: [ruby-core:04402]

* ext/curses/curses.c (window_color_set): [ruby-core:04393]

* ext/socket/socket.c (Init_socket): SO_REUSEPORT added.
  [ruby-talk:130092]

* object.c: [ruby-doc:818]

* parse.y (open_args): fix too verbose warnings for the space
  before argument parentheses.  [ruby-dev:25492]

* parse.y (parser_yylex): ditto.

* parse.y (parser_yylex): the first expression in the parentheses
  should not be a command.  [ruby-dev:25492]

* lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330]

* object.c (Init_Object): remove Object#type.  [ruby-core:04335]

* st.c (st_foreach): report success/failure by return value.
  [ruby-Bugs-1396]

* parse.y: forgot to initialize parser struct.  [ruby-dev:25492]

* parse.y (parser_yylex): no tLABEL on EXPR_BEG.
  [ruby-talk:127711]

* document updates - [ruby-core:04296], [ruby-core:04301],
  [ruby-core:04302], [ruby-core:04307]

* dir.c (rb_push_glob): should work for NUL delimited patterns.

* dir.c (rb_glob2): should aware of offset in the pattern.

* string.c (rb_str_new4): should propagate taintedness.

* env.h: rename member names in struct FRAME; last_func -> callee,
  orig_func -> this_func, last_class -> this_class.

* struct.c (rb_struct_set): use original method name, not callee
  name, to retrieve member slot.  [ruby-core:04268]

* time.c (time_strftime): protect from format modification from GC
  finalizers.

* object.c (Init_Object): remove rb_obj_id_obsolete()

* eval.c (rb_mod_define_method): incomplete subclass check.
  [ruby-dev:25464]

* gc.c (rb_data_object_alloc): klass may be NULL.
  [ruby-list:40498]

* bignum.c (rb_big_rand): should return positive random number.
  [ruby-dev:25401]

* bignum.c (rb_big_rand): do not use rb_big_modulo to generate
  random bignums.  [ruby-dev:25396]

* variable.c (rb_autoload): [ruby-dev:25373]

* eval.c (svalue_to_avalue): [ruby-dev:25366]

* string.c (rb_str_justify): [ruby-dev:25367]

* io.c (rb_f_select): [ruby-dev:25312]

* ext/socket/socket.c (sock_s_getservbyport): [ruby-talk:124072]

* struct.c (make_struct): [ruby-dev:25249]

* dir.c (dir_open_dir): new function.  [ruby-dev:25242]

* io.c (rb_f_open): add type check for return value from to_open.

* lib/pstore.rb (PStore#transaction): Use the empty content when a
  file is not found.  [ruby-dev:24561]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-04 06:47:45 +00:00
matz fbb88b011a * io.c (rb_io_mode_flags): preserve append mode flag.
[ruby-dev:24436]

* io.c (rb_io_modenum_mode): do not use external output buffer.

* string.c (rb_str_justify): differ pointer retrieval to prevent
  padding string modification.  [ruby-dev:24434]

* range.c (range_each_func): allow func to terminate loop by
  returning RANGE_EACH_BREAK.

* range.c (member_i): use RANGE_EACH_BREAK. [ruby-talk:114959]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-06 07:40:06 +00:00
matz c800d0b75d * io.c (rb_fopen): mode string copy at the lowest level.
* io.c (rb_io_flags_mode): requires output buffer no more.  no
  allocation needed.

* array.c (rb_ary_index): takes a block to compare items in an
  array.  [ruby-talk:113069] [Ruby2]

* array.c (rb_ary_rindex): ditto.

* marshal.c (r_byte): retrieve pointer from string value for each
  time.  [ruby-dev:24404]

* marshal.c (r_bytes0): ditto.

* enum.c (sort_by_i): re-entrance check added.  [ruby-dev:24399]

* io.c (io_read): should freeze all reading buffer.
  [ruby-dev:24400]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-05 01:37:46 +00:00
nobu 73cf1d02ba * lib/pstore.rb (PStore#transaction): get rid of opening in write mode
when read only transaction.  [ruby-dev:23842]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-01 09:31:37 +00:00
matz 979de48915 * lib/pstore.rb (transaction): allow overriding dump and load.
[ruby-dev:23567]

* lib/yaml/store.rb: follow lib/pstore.rb's change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-27 07:43:38 +00:00
eban 4774e8fda5 * lib/pstore.rb (commit_new): use FileUtils.copy_stream for Cygwin.
[ruby-dev:23157]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-07 13:37:52 +00:00
matz 4b41d18b6c * sprintf.c (rb_f_sprintf): preserve original val for
format_integer. [ruby-talk:92975]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-17 15:26:03 +00:00
matz 6d481a4ae4 * hash.c (env_clear): new Hash compatible method.
* hash.c (env_shift): ditto.

* hash.c (env_invert): ditto.

* hash.c (env_replace): ditto.

* hash.c (env_update): ditto.

* array.c (rb_ary_join): dispatch based on "to_str".

* array.c (rb_ary_times): ditto.

* array.c (rb_ary_equal): ditto.

* process.c (rb_f_exec): dispatch based on "to_ary".

* eval.c (umethod_bind): exact class match is not required.  relax
  the restriction to subclasses.

* eval.c (rb_eval): call "inherited" before executing class body.

* class.c (rb_define_class): call "inherited" after defining the
  constant.

* class.c (rb_define_class_under): ditto.

* eval.c (massign): expand first element if RHS is an array and
  its size is 1, and LHS has concrete assignment target (i.e. LHS
  has target(s) other than *var).

* eval.c (massign): avoid unnecessary avalue/svalue conversion.

* eval.c (rb_yield_0): ditto

* array.c (rb_ary_update): do not allocate unused array if rpl is
  nil (i.e. merely removing elements).

* io.c (io_read): should resize supplied string if it's shorter
  than expected.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-07 07:36:40 +00:00
matz a1c02ee495 * math.c (math_acos): check errno after operation. ditto for
asin, acosh, atanh, log, log10 and sqrt.

* eval.c (rb_add_method): initialize should always be private.

* parse.y (expr): add rescue modifier rule.

* parse.y (command_call): return, break and next with argument is
  now part of this rule.

* parse.y (yylex): "a" in "a /5" should be considered as a local
  variable. [experimental]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-14 06:18:59 +00:00
matz be1d2c5f68 * string.c (rb_str_slice_bang): if there's no corresponding
substring, slice! should return nil without exception.

* array.c (rb_ary_insert): type fixed.

* string.c (rb_str_split_m): accept separator value nil as well.

* string.c (rb_str_become): was leaking memory.

* class.c (rb_include_module): should not alter other
  classes/modules by inclusion.  by this fix, local order may not
  be preserved for some cases.

* class.c (include_class_new): module may be T_ICLASS; retrieve
  original module information.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-11 08:22:18 +00:00
matz 05b4ec8683 * parse.y (yylex): __END__ should not be effective within
string literals.

* parse.y (here_document): should be aware of __END__ within here
  documents.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-24 07:59:02 +00:00
knu 31e15f7606 Reflect the update of the MD5 module which is now Digest::MD5.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-01 14:07:01 +00:00
matz df96f994f1 * parse.y (parse_regx): should raise error on untermitated
expression interpolation.

* pack.c (pack_unpack): should give length to utf8_to_uv().

* pack.c (utf8_to_uv): add length check.

* massages: replace "wrong #" by "wrong number".

* marshal.c (w_float): output Infinity and NaN explicitly.

* marshal.c (r_object): support new explicit float format.

* eval.c (rb_thread_wait_for): select may cause ERESTART on
  Solaris.

* eval.c (rb_thread_select): ditto.

* array.c (rb_ary_join): dumped core if sep is not T_STRING nor T_NIL.

* array.c (rb_ary_join): buffer size calculattion was wrong.

* array.c (rb_ary_to_s): if rb_output_fs is nil, insert newlines
  between array elements (use rb_default_rs as newline litral)
  [experimental].

* gc.c (init_mark_stack): no need to clear mark_stack.

* gc.c (gc_mark_all): need to handle finalizer mark.

* gc.c (gc_mark_rest): use MEMCPY instead of memcpy.

* gc.c (rb_gc_mark): earlier const check to avoid pusing special
  constants into mark stack.

* numeric.c (fix_to_s): 'to_s' now takes optional argument to
  specify radix. [new]

* bignum.c (rb_big_to_s): ditto. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-19 05:03:03 +00:00
matz 1fe40b7cc5 * marshal.c (r_object): better allocation type check for
TYPE_UCLASS. usage of allocation framework is disabled for now.

* variable.c (rb_class_path): Module may have subclass.

* string.c (rb_str_update): should maintain original negative
  offset.

* string.c (rb_str_subpat_set): ditto

* string.c (rb_str_aset): ditto.

* re.c (rb_reg_nth_match): should check negative nth.

* re.c (rb_reg_nth_defined): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-03 07:19:19 +00:00
matz c8a7361e45 * marshal.c (Init_marshal): new constant Marshal::MAJOR_VERSION
and Marshal::MINOR_VERSION.

* marshal.c (marshal_load): ruby_verbose test should be wrapped by
  RTEST().

* hash.c (rb_hash_index): should return nil (not the default
  value) if value is not in the hash.

* numeric.c (num_div): new method added.  alias to '/' which
  should be preserved even if '/' is redefined (e.g. by
  mathn). [new]

* bignum.c (rb_cstr2inum): "0 ff".hex should return 0, not 255.

* file.c (rb_file_s_expand_path): fixed using CharNext().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-31 06:24:45 +00:00
matz 1d3d27b42d forgot some checkins.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-05-06 15:06:00 +00:00
matz 6c11709d4c matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-10-11 06:29:16 +00:00
matz f1bb1f5848 000919
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-09-19 07:54:28 +00:00
matz 97f8593cf8 pstore abort handle
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-06-13 09:04:40 +00:00