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

901 Коммитов

Автор SHA1 Сообщение Дата
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 bce7601f73 * string.c (rb_str_subpat_set): must make str independent after
rb_reg_search() matched.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-14 00:10:49 +00:00
nobu f963fa6956 typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-14 00:04:05 +00:00
nobu a1f4ea2127 * dir.c (rb_push_glob): avoid SEGV when no block given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-13 23:59:41 +00:00
knu b9522c1687 * dir.c: FNM_PERIOD is obsoleted and FNM_DOTMATCH is introduced
instead, which has the opposite meaning of FNM_PERIOD.

* dir.c: Dir::glob now accepts optional FNM_* flags via the second
  argument, whereas Dir::[] doesn't.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-13 10:11:09 +00:00
knu 14461ddae6 * lib/getopts.rb: single_options can be nil[*], and is not not
optional. ([*]Pointed out by gotoken)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-13 09:44:59 +00:00
matz 43b18e733d * regex.c (re_compile_pattern): '\0111' should be '\011' plus '1',
since octal literals are formed by three digits at most.

* marshal.c (w_object): module inclusion using extend() should
  also be detected.

* eval.c (rb_eval_cmd): cbase should not be NULL; it should be
  either ruby_wrapper or Object.

* enum.c (enum_each_with_index): should return self.

* process.c (proc_setpgrp): should return value for non-void function.

* process.c (proc_getpgid): should raise exception if getpgid() return -1.

* string.c (rb_str_ljust): should return a duplicated string.

* string.c (rb_str_rjust): ditto.

* string.c (rb_str_center): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-12 09:28:50 +00:00
akr 230034b7ab * lib/resolv.rb: don't complete domains for absolute FQNs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-12 08:12:32 +00:00
akr 8b9823a23d * lib/tsort.rb: new file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-11 14:09:11 +00:00
nobu 5152350dc8 StringIO
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-11 12:39:23 +00:00
matz 86c6af5873 * marshal.c (w_object): module inclusion using extend() should
also be detected.

* eval.c (rb_eval_cmd): cbase should not be NULL; it should be
  either ruby_wrapper or Object.

* enum.c (enum_each_with_index): should return self.

* process.c (proc_setpgrp): should return value for non-void function.

* process.c (proc_getpgid): should raise exception if getpgid() return -1.

* string.c (rb_str_ljust): should return a duplicated string.

* string.c (rb_str_rjust): ditto.

* string.c (rb_str_center): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-11 08:02:04 +00:00
akr 81930da895 * ext/socket/extconf.rb (have_struct_member): don't print checked
result.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-08 23:47:36 +00:00
matz d497898c23 * eval.c (cvar_cbase): utility function to find innermost non
singleton cbase.

* eval.c (is_defined): adopt new cvar behavior.

* eval.c (rb_eval): ditto.

* eval.c (assign): ditto.

* class.c (rb_mod_clone): should not call rb_obj_clone(), since
  Module does not provide "allocate".

* class.c (rb_singleton_class): should crate new singleton class
  if obj is a class or module and attached object is different,
  which means metaclass of singleton class is sought.

* time.c (time_s_alloc): now follows allocation framework.

* eval.c (rb_eval): should initialize outer class variables from
  methods in singleton class definitions.

* eval.c (assign): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-08 07:03:09 +00:00
akr d41f53d0b6 * lib/resolv.rb: use its own thread group for background threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-08 03:19:53 +00:00
nobu effd8230ea * gc.c (rb_source_filename): added. holds unique strings for file
names with GC space.

* gc.c (rb_gc_mark): mark source file name.

* gc.c (gc_sweep): ditto.

* gc.c (Init_GC): initialize source file name table.

* intern.h (rb_source_filename): added.

* eval.c (rb_eval_string): use rb_source_filename().

* parse.y (yycompile): ditto.

* ruby.c (proc_options): ditto.

* ruby.c (load_file): ditto.

* ruby.c (ruby_script): ditto.

* ruby.c (ruby_prog_init): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-07 11:19:37 +00:00
eban 6dc931e59f * dln.c (dln_load): use LoadLibrary instead of LoadLibraryEx.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-06 09:00:32 +00:00
knu d99f6d7ff6 - Slightly fix one of the last entries. (stdin -> stdin or stdout)
- Fix indentation.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-04 21:29:11 +00:00
knu f2dfae7ea0 * lib/getopts.rb: Rewrite to fix some bugs and complete features.
- Accept options with the colon in the first argument;
    getopts("a:bcd:") is equivalent to getopts("bc", "a:", "d:").
  - Do not discard the argument that caused an error.
  - Do not discard '-', which commonly stands for stdin.
  - Allow specifying a long option with a value using '='.
    (command --long-option=value)
  - Stop reading options when it meets a non-option argument.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-04 21:15:47 +00:00
knu ab1b4b5869 * ext/extmk.rb.in (dir_config): Sync with mkmf.rb: Fix a bug where
--with-xx-{include,lib} is ignored when --with-xx-dir is
  specified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-04 04:24:26 +00:00
akr 9496c3776d fix method name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-03 11:03:05 +00:00
eban 1188f3f1d9 * ext/socket/{addinfo.h,getaddrinfo.c} (gai_strerror): add const
qualifier only for uClibc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-01 02:32:21 +00:00
shugo a5ecc30e7d * ChangeLog: fixed the description of getacl.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-01 02:30:08 +00:00
shugo 4a58b0fd7c * lib/net/imap.rb: added document.
* lib/net/imap.rb (getquotaroot): new method.
* lib/net/imap.rb (setacl): remove the rights if the rights
parameter is nil.
* lib/net/imap.rb (getacl): return a MailboxACLItem object.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-01 02:27:37 +00:00
akr 7806b0ae28 * dln.c (dln_load): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-28 22:05:01 +00:00
akr 4efd36bbd9 * ext/socket/extconf.rb (have_struct_member): new method.
check msg_control and msg_accrights in struct msghdr.  check sys/uio.h.

* socket/socket.c: include sys/uio.h if available.
(thread_read_select): new function.
(unix_send_io): ditto.
(unix_recv_io): ditto.
(unix_s_socketpair): ditto.
(Init_socket): define UNIXSocket#send_io, UNIXSocket#recv_io,


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-28 21:31:35 +00:00
matz e88d2cec1f * eval.c (rb_mod_include): load modules in argument order.
* st.c (st_init_table_with_size): num_bins should be prime numbers
  (no decrement).

* st.c (rehash): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-28 06:53:33 +00:00
matz 3fc04d9361 * ext/dbm/dbm.c (fdbm_select): 1.7 behavior.
* ext/gdbm/gdbm.c (fgdbm_select): ditto.

* ext/sdbm/sdbm.c (fsdbm_select): ditto.

* ext/dbm/dbm.c (fdbm_delete): adopt Hash#delete behavior.

* ext/sdbm/sdbm.c (fsdbm_delete): ditto.

* ext/gdbm/gdbm.c: need not to dup key to the block.

* ext/sdbm/sdbm.c : replace RuntimeError with SDBMError.

* eval.c (rb_f_missing): NoMethod error messages for true, false,
  nil must respond visibility like for other objects.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-27 04:52:21 +00:00
eban 2fcd221fec * io.c (READ_DATA_PENDING): uClibc support.
* random.c (rand_init): ditto.
* ext/socket/{addinfo.h,getaddrinfo.c} (gai_strerror): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-27 04:30:20 +00:00
knu 4e840877aa * ext/digest/sha2/sha2.c: Merge from rough. Fix a couple of
off-by-one errors in Aaron Gifford's code.

  Obtained from:  KAME via FreeBSD
  KAME PR:        393
  FreeBSD PR:     kern/34242


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-26 22:09:49 +00:00
usa 210ebe1acf * bignum.c (rb_big_2comp): void function cannot return any value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-26 12:36:26 +00:00
matz 8d456d453c * eval.c (rb_eval): call trace_func for if/while conditions.
* marshal.c (r_object): separate r_regist from proc calling.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-26 06:48:59 +00:00
akira 3916df613e * lib/uri/generic.rb: merge0 shuld return [oth, oth] if oth is absolute URI.
* lib/uri/generic.rb: registry part must not be allowed for any schemes for the Internet. (RFC2396, section 3.2.2 and 3.2.1.)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-26 02:36:05 +00:00
knu 09290070e8 * ext/syslog/syslog.c: Merge from rough. Use SafeStringValue().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-25 12:23:47 +00:00
knu b700e189bd * ext/syslog/syslog.c: Merge from rough. Turn Syslog into a
module keeping backward compatibility intact.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-25 12:13:30 +00:00
nobu 0778120490 * sample/test.rb (system): test with scripts under the source
directory.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-25 10:43:13 +00:00
matz 6d47b8a9cc * eval.c (method_inspect): should not dump core for unbound
singleton methods.

* object.c (rb_mod_to_s): better description.

* hash.c (env_select): should path the assoc list.

* process.c (rb_syswait): thread kludge; should be fixed to
  support native thread.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-25 09:16:25 +00:00
nobu aaa30fd040 * lib/shell.rb (Shell::expand_path): relative to @cwd.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-25 04:35:12 +00:00
knu 3dc9d269e2 * ext/digest/*/*.h: Merge from rough.
- Avoid namespace pollution. (MD5_* -> rb_Digest_MD5_*, etc.)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-24 08:25:09 +00:00
akr 56438ac66d fix filename.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-22 12:43:05 +00:00
aamine d3b66ccf45 * lib/net/protocol.rb: set read_timeout dynamically.
* lib/net/http.rb: @@newimpl is always true in the main trunk.
* lib/net/http.rb: HTTP.port -> default_port
* lib/net/http.rb: HTTPResponse.read_response_status -> read_status_line


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-22 12:10:58 +00:00
usa 9ca5b918eb * win32/config.status.in: set LIBRUBY_SO.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-22 10:59:46 +00:00
matz 088d04d88e * bignum.c (get2comp): need to specify to carry or not.
* io.c (rb_io_inspect): embed path info.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-22 10:28:47 +00:00
akr 9ce7325615 * prettyprint.rb: FillGroup implemented.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-22 02:31:46 +00:00
usa 5024bd594d * ext/extmk.rb.in (create_makefile): remove unnecessary -L option from
LIBS macro.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-21 12:42:32 +00:00
matz a08cea360d * pack.c (pack_pack): wrong # comment treatment.
* pack.c (pack_unpack): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-21 07:15:06 +00:00
nobu 0eb1a2ff6d * intern.h: prototypes; rb_io_addstr(), rb_io_printf(),
rb_io_print(), rb_io_puts()

* io.c (rb_io_addstr): make extern.

* io.c (rb_io_printf): ditto.

* io.c (rb_io_print): ditto.

* io.c (rb_io_puts): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-20 06:35:37 +00:00
usa 4fd111f0c1 * io.c (rb_io_close): return Qnil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-20 04:42:49 +00:00
matz c46468d773 * hash.c (rb_any_cmp): should handle Qundef in keys.
* eval.c (remove_method): should not remove a empty method to
  implement "undef".

* eval.c (rb_eval): should allow singleton class def for
  true/false/nil.

* parse.y (str_extend): backslash escape was done wrong.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-20 04:31:50 +00:00
aamine 19f7f6ea12 aamine
* lib/net/protocol.rb: rename Protocol.port to default_port.
* lib/net/smtp.rb: ditto.
* lib/net/pop.rb: ditto.
* lib/net/http.rb: ditto.
* lib/net/protocol.rb: rename BufferedSocket class to InternetMessageIO.
* lib/net/smtp.rb: ditto.
* lib/net/pop.rb: ditto.
* lib/net/http.rb: ditto.
* lib/net/protocol.rb: rename InternetMessageIO#write_pendstr to write_message.
* lib/net/smtp.rb: ditto.
* lib/net/protocol.rb: new method InternetMessageIO#through_message.
* lib/net/smtp.rb: ditto.
* lib/net/protocol.rb: rename InternetMessageIO#read_pendstr to read_message_to.
* lib/net/pop.rb: ditto.
* lib/net/protocol.rb: rename InternetMessageIO#read_pendlist to each_list_item
* lib/net/pop.rb: ditto.
* lib/net/protocol.rb: Now block size is 1024.
* lib/net/smtp.rb: new methods SMTP#esmtp? and #esmtp=.
* lib/net/http.rb: Using singleton method syntax instead of singleton class clause, to avoid behavior change of class variables in ruby 1.7.
* lib/net/http.rb: HTTPResponse class does not inherit from Net::Response.
* lib/net/http.rb: devide HTTP#connecting into {begin,end}_transport.
* lib/net/http.rb: unused class Accumulator removed.
* lib/net/http.rb: Net::HTTP reads response. not HTTPRequest.
* lib/net/http.rb: proxy related class-instance-variables are not initialized correctly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-19 12:33:52 +00:00
nobu c1bfef9494 * file.c (path_check_1): do not fail on world writable *parent*
directories too.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-19 08:13:26 +00:00
matz 9eae31d569 * file.c (path_check_1): do not warn on world writable *parent*
directories.

* class.c (rb_include_module): should preserve ancestor order in
  the included class/module.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-19 07:47:07 +00:00
matz e60deb1555 * file.c (path_check_1): should check directory sticky bits.
* process.c (security): need not to warn twice.

* marshal.c (r_object): complete restoration before calling
  r_regist().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-19 06:43:58 +00:00
matz 87bf8b1dc3 * parse.y (yylex): operators in the "op" rule should make
lex_state EXPR_ARG on EXPR_FNAME and EXPR_DOT.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-19 05:39:06 +00:00
matz d1ca5e6d6a * eval.c (rb_eval_string_wrap): should hide the toplevel local
variable bindings by PUSH_SCOPE().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-19 04:49:27 +00:00
eban 1a7929a969 * regex.c: fix prototypes of xmalloc(), xcalloc() and xrealloc().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-19 04:25:39 +00:00
nobu 0cbfe8c524 * io.c (rb_io_ungetc): don't fail pushed EOF back.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-19 04:19:06 +00:00
nobu 7ef48b40ba * pack.c (pack_pack): avoid infinite loop at comment.
* pack.c (pack_unpack): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-18 11:51:10 +00:00
matz 7de72c4858 * parse.y (expr_value, arg_value, primary_value): value_expr()
check in place.

* eval.c (block_pass): "&nil" should clear block given.

* dir.c (push_braces): remove MAXPATHLEN dependency.

* dir.c (dir_s_globd): ditto.

* dln.c (init_funcname): ditto.

* dln.c (load_1): ditto.

* dln.c (dln_load): ditto.

* configure.in: add GNU/Hurd switches.

* pack.c (pack_pack): allows comment in template strings.

* pack.c (pack_unpack): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-18 09:52:48 +00:00
nobu 3432cecf24 * misc/ruby-mode.el (ruby-block-hanging-re): rescue block was too
indented.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-18 05:17:53 +00:00
nobu 4dd348b2b4 * misc/ruby-mode.el (ruby-font-lock-keywords): fontify
instance/class/global variables start with '_'.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-17 15:31:37 +00:00
nobu 21d0c3b815 * mkconfig.rb (Config::expand): expand ${} too.
* ext/extmk.rb.in (try_link0): expand command.

* ext/extmk.rb.in (try_cpp): ditto.

* ext/extmk.rb.in (extmake): default $LIBPATH to $libdir


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-17 14:46:44 +00:00
nobu 11829a5368 * class.c (rb_define_class): warn unless superclass is specified
explicitly.

* class.c (rb_define_class_under): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-17 14:44:14 +00:00
nobu c4449fd4c4 * ext/digest/md5/md5init.c (Init_md5): rb_cvar_declare() is
replaced by rb_cvar_set().

* ext/digest/rmd160/rmd160init.c (Init_rmd160): ditto.

* ext/digest/sha1/sha1init.c (Init_sha1): ditto.

* ext/digest/sha2/sha2init.c (Init_sha2): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-17 12:43:44 +00:00
nobu beb24c5888 * regex.c (re_compile_fastmap): skip begpos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-16 00:58:51 +00:00
matz 1e5d404935 * eval.c (rb_eval): replace rb_cvar_declare() by rb_cvar_set().
* eval.c (assign): ditto.

* variable.c (rb_cvar_set): 4th argument (warn) added; define new
  class variable if it's not defined yet.

* variable.c (rb_cvar_declare): removed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-15 06:14:26 +00:00
matz 289430e8ec * bignum.c (rb_big_rshift): should properly convert the nagative
value to 2's compliment.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-15 04:43:58 +00:00
nobu 9ae27073fa * parse.y: avoid SEGV at OP_ASIGN to pseudo variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-14 08:47:58 +00:00
matz aac5ff0031 * struct.c (Init_Struct): should undefine "allocate" for Struct
class (it's redefined in the subclasses).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-14 07:49:27 +00:00
matz ba8fc117c5 * parse.y (stmt): local variable declaration order was changed
since 1.6

* parse.y (arg): ditto.

* pack.c (pack_pack): add templates 'q' and 'Q'.

* pack.c (pack_unpack): ditto.

* bignum.c (rb_quad_pack): new utility function.

* bignum.c (rb_quad_unpack): ditto.

* parse.y (assignable): should emit CVASGN within the method
  body.

* dir.c (dir_s_glob): should not warn even if no match found.

* eval.c (rb_eval): clean up class variable behavior.

* eval.c (assign): ditto.

* eval.c (is_defined): ditto.

* variable.c (rb_mod_class_variables): need not to call rb_cvar_singleton().

* variable.c (rb_cvar_singleton): removed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-13 09:01:11 +00:00
nobu 1995213e4b * ruby.c (load_file): avoid SEGV on '#' only input.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-10 07:55:40 +00:00
matz f2f74e91bf * eval.c (rb_eval): singleton chech should be moved from yycompile
to here.

* eval.c (is_defined): check should be added here too.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-09 14:47:52 +00:00
matz 0a396e3ebb * parse.y (yycompile): should inherit "in_single" if eval happened
in a singleton method.

* eval.c (rb_eval): class variables from singleton methods defined
  within singleton class statement should work like ones defined
  by sington def statements.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-08 05:20:34 +00:00
aamine ffc3c4b401 aamine
* lib/net/http.rb: HTTP.Proxy should use self for proxy-class's super class.
* lib/net/http.rb: initialize HTTP.proxy_port by HTTP.port.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-07 20:22:39 +00:00
akira 91a3db0afc uri-0.9.5
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-07 04:51:11 +00:00
matz 90991d9889 * io.c (io_write): flag when buffered write is done.
* io.c (fptr_finalize): do not raise error on EBADF if write
  buffer is empty.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-07 04:18:08 +00:00
nobu 65806ccb72 * configure.in: keep old config.h unless changed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-06 08:25:00 +00:00
matz d77119bfe4 * io.c (rb_io_readlines): avoid calling GetOpenFile() repeatedly.
* io.c (rb_io_each_line): ditto.

* io.c (argf_getline): ditto.

* process.c: should include <time.h> to get proper CLK_TCK.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-06 07:30:13 +00:00
shugo 6bebc82c03 * lib/net/imap.rb: OpenSSL support.
* lib/net/imap.rb (setquota): unset quota if the second argument is nil.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-06 04:39:00 +00:00
nobu cc2ab3aca6 * io.c (fptr_finalize): ignore EBADF when f and f2 use same
descriptor.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-05 17:10:54 +00:00
matz 8210c254be * io.c (fptr_finalize): should raise error when fclose fails.
* eval.c (method_inspect): proper output format to distinguish
  methods and singleton methods.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-05 07:56:31 +00:00
nobu 49c720ff67 * file.c (rb_file_s_expand_path): should terminate.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-04 13:49:05 +00:00
matz 43f68272c7 * object.c (rb_class_real): should not follow ICLASS link
* variable.c (classname): should follow ICLASS link explicitly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-04 08:09:14 +00:00
nobu c2269d5b4f * intern.h: prototypes for new functions; rb_cstr_to_inum(),
rb_str_to_inum(), rb_cstr_to_dbl(), rb_str_to_dbl()

* bignum.c (rb_cstr_to_inum): changed from rb_cstr2inum(), and
  added argument badcheck to be consistent with parser. [new]

* bignum.c (rb_str_to_inum): ditto.

* bignum.c (rb_cstr2inum): wapper of rb_cstr_to_inum() now.

* bignum.c (rb_str2inum): ditto.

* object.c (rb_cstr_to_dbl): float number parser. [new]

* object.c (rb_str_to_dbl): ditto.

* object.c (rb_Float): use rb_cstr_to_dbl() for strict check.

* object.c (rb_Integer): use rb_str_to_inum() for strict check.

* string.c (rb_str_to_f): use rb_str_to_dbl() with less check.

* string.c (rb_str_to_i): use rb_str_to_inum() with less check.

* string.c (rb_str_hex): ditto.

* string.c (rb_str_oct): ditto.

* sprintf.c (rb_f_sprintf): ditto.

* time.c (obj2long): ditto.

* parse.y (yylex): use rb_cstr_to_inum() for strict check.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-01 10:23:22 +00:00
nobu d9b49e39b2 * regex.c (mbc_startpos): become macro.
* regex.c (euc_startpos): added for improvement.

* regex.c (sjis_startpos): ditto.

* regex.c (utf8_startpos): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-01 08:49:02 +00:00
matz 9f0d9bd711 * file.c (rb_stat_inspect): print dev, rdev in hexadecimal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-01 06:03:03 +00:00
nobu 3d51761abd * lib/mkmf.rb (dir_config): prior --with flag.
* lib/mkmf.rb (arg_config): avoid special variables for
  font-lock-mode.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-31 12:03:08 +00:00
akr caa76f71fb * lib/pp.rb (File::Stat#pretty_print): print rdev_major and rdev_minor.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-31 04:24:04 +00:00
nobu 33158860f4 * regex.c (re_adjust_startpos): fix for SJIS and UTF-8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-30 07:12:55 +00:00
nobu ae2d54d91d * regex.c (re_adjust_startpos): fix for SJIS.
* regex.c (mbc_startpos): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-30 07:00:58 +00:00
nobu 7ddde51c68 * regex.c (re_adjust_startpos): search start of multibyte
backward.

* regex.c (mbc_startpos): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-29 19:33:11 +00:00
akr 46d98fe87b * lib/pp.rb: don't print a mode File::Stat as decimal number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-29 10:01:41 +00:00
akr 94acb9c6bc * file.c: `major' and `minor' macro needs sys/mkdev.h on SunOS 5.x.
* configure.in: add check for `sys/mkdev.h'.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-29 09:15:59 +00:00
matz 86298123d7 * file.c (rb_stat_rdev_major): added. [new]
* file.c (rb_stat_rdev_minor): added. [new]

* file.c (rb_stat_inspect): print mode in octal.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-29 07:16:09 +00:00
nobu e9d17f8a22 * array.c (rb_ary_fill): shouldn't yield unless block given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-28 10:18:14 +00:00
nobu 8a95f7f981 * parse.y (yylex): strict check for numbers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-28 09:33:56 +00:00
matz 4f38c453b4 * eval.c (is_defined): defined?(Foo::Baz) should check constants
only, no methods.

* eval.c (is_defined): should not dump core on defined?(a::b)
  where a is not a class nor a module.

* object.c (Init_Object): remove dup and clone from TrueClass,
  FalseClass, and NilClass.

* array.c (rb_ary_fill): Array#fill takes block to get the value to
  fill.

* string.c (rb_str_to_i): to_i(0) auto-detects base radix.

* array.c (rb_ary_initialize): fill by the block evaluation value
  if block is given.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-28 08:44:45 +00:00
eban ae6afaaedb * configure.in (solaris): add '-shared' only for GNU ld.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-25 09:00:51 +00:00
eban a0bf3b3bb9 * configure.in (solaris): add '-shared' only for GNU ld.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-25 09:00:50 +00:00
matz f547c1150c * class.c (rb_include_module): detect cyclic module inclusion.
* eval.c (rb_thread_cleanup): need not to free thread stacks at
  process termination.

* array.c (rb_ary_fetch): use the block to get the default value
  if the block is given.

* eval.c (rb_thread_schedule): should check time only if BOTH
  WAIT_SELECT and WAIT_TIME.

* eval.c (umethod_bind): should update rklass field.

* hash.c (rb_hash_update): if a block is given, yields [key,
  value1, value2] to the block to resolve conflict.

* string.c (rb_str_split_m): no need to consider KANJI
characters, if the length of separator is 1 (byte).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-25 08:22:11 +00:00
matz eb9708f386 * array.c (Init_Array): remove Array#filter.
* object.c (rb_mod_initialize): should accept zero argument.

* object.c (rb_mod_cmp): should raise ArgumentError if
  inheritance/inclusion relation between two classes/modules is
  not defined. [new]

* io.c (rb_io_fsync): new method. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-23 07:30:43 +00:00
nobu 9ffccf4762 * eval.c (rb_yield_0): restore source file/line after yield.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-23 07:24:26 +00:00
nobu 68f6704478 * signal.c (ruby_signal): must define sighandler_t unless
POSIX_SIGNAL.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-21 13:59:41 +00:00
matz b03bdcd64f * eval.c (ruby_stop): should not trace error handler.
* signal.c (install_sighandler): do not install sighandler unless
  the old value is SIG_DFL.

* io.c (io_write): should not raise exception on O_NONBLOCK io.

* dir.c (dir_set_pos): seek should return dir, pos= should not.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-21 07:44:06 +00:00
matz d102ce6d09 * eval.c (rb_eval): need not to clar method cache for NODE_CLASS,
NODE_SCLASS.

* gc.c (obj_free): need not to clear method cache on class/module
  finalization.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-19 14:22:27 +00:00
matz a7a7324ea6 * io.c (rb_io_s_new): block check moved from initialize to this
method.

* io.c (rb_io_s_open): open should call initialize too. IO#for_fd
  also calls initialize. [new]

* error.c (rb_sys_fail): replace INT2FIX() by INT2NUM() since
  errno value may not fit in Fixnum size on Hurd.

* error.c (set_syserr): ditto.

* dir.c (dir_s_glob): returns nil if block given.

* io.c (rb_io_each_byte): should return self.

* io.c (rb_io_close_m): close check added.

* dir.c (dir_seek): should return pos.

* parse.y (fixpos): orig may be (NODE*)1, which should not be
  dereferenced.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-18 14:24:01 +00:00
usa 9bb82109f7 * ext/socket/socket.c (tcp_svr_s_open): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-18 01:13:58 +00:00
matz 36192dfa4a * eval.c (block_pass): allow "retry" from within argument passed
block. [new]

* eval.c (localjump_error): should preserve exit status in the
  exception object. [new]

* eval.c (proc_invoke): should raise exception for "break" if it's
  yielding, not calling. [new]

* eval.c (block_pass): should NOT raise exception for "break". [new]

* eval.c (block_pass): should allow block argument relay even in
  the tainted mode.

* ext/socket/socket.c: support subclassing by proper "initialize"
  calling convention. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-17 08:05:01 +00:00
matz c0a636b6f9 * st.c: primes should be primes.
* eval.c (is_defined): method defined? check should honor
  protected too.

* eval.c (block_pass): should not pass tainted block, if $SAFE > 0.

* variable.c (rb_mod_remove_cvar): should pass the char*.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-16 09:25:59 +00:00
akr 17e1cfef8c * lib/timeout.rb (timeout): new optional argument to specify an
exception class.

* lib/resolv.rb: use Resolv::ResolvTimeout for internal timeout to
avoid problem with timeout of application.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-16 03:37:23 +00:00
nobu 5fe2879fd5 * object.c (rb_Float): remove underscores between digits.
* bignum.c (rb_cstr2inum): reject prefix followed by spaces only.

* class.c (rb_class_inherited): should use Object when no super
  class.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-16 02:20:25 +00:00
matz 85e32dd221 * re.c (match_select): should propagate taintness.
* hash.c (rb_hash_set_default): Hash#default= should return the
  new value.

* string.c (rb_str_to_i): accepts optional base argument. [new]

* numeric.c (rb_fix2str): should not handle negative fixnum values
  int32 via calling sprintf() directly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-11 09:18:54 +00:00
nobu 5915dc245e * class.c (rb_make_metaclass): [new]
* class.c (rb_define_class_id): use rb_make_metaclass(), don't
  call Class#inherited hook.

* class.c (rb_class_inherited): [new]

* class.c (rb_define_class): call Class#inherited hook here.

* class.c (rb_define_class_under): ditto after class path is set.

* class.c (rb_singleton_class): use rb_make_metaclass().

* eval.c (rb_eval): same as rb_define_class_under().

* intern.h: prototypes of rb_make_metaclass() and
  rb_class_inherited().

* object.c (rb_class_s_new): use rb_make_metaclass() and
  rb_class_inherited().

* object.c (Init_Object): use rb_make_metaclass().

* struct.c (make_struct): use rb_class_inherited().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-10 20:18:39 +00:00
nobu 1b4be57f7e * eval.c (rb_add_method): should clear cache by id always.
* eval.c (rb_disable_super): no longer need to clear cache before
  rb_add_method().

* eval.c (rb_export_method): ditto.

* eval.c (rb_attr): ditto.

* eval.c (rb_undef): ditto.

* eval.c (rb_eval): ditto.

* eval.c (rb_mod_modfunc): ditto.

* eval.c (rb_mod_define_method): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-10 13:30:17 +00:00
usa d92e9de3b8 * win32/resource.rb: Modify copyright in resource script.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-10 02:43:06 +00:00
nobu dffbc4d7f1 * misc/ruby-mode.el (ruby-calculate-indent): indentation after
comment at beginning of buffer failed.

* misc/ruby-mode.el (font-lock-defaults): unless XEmacs, set
  font-lock variables in ruby-mode-hook.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-09 17:52:12 +00:00
nobu 1a101d775a * eval.c (rb_add_method): clear replaced method from the cache.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-08 07:02:26 +00:00
matz c9f4686694 * string.c (rb_str_new2): NULL pointer check added.
* class.c (rb_define_module_under): should locate predefined
  module using rb_const_defined_at().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-07 05:27:01 +00:00
akr 6a100f3ce4 * lib/time.rb (Time#xmlschema): new optional argument
fractional_seconds to specify a number of digits of
fractional part of the time.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-07 03:56:55 +00:00
nobu 427237f889 misordered.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-05 16:09:46 +00:00
nobu 1cc7986a11 * range.c (range_member): beginning check was
wrong. [ruby-talk:30252]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-05 04:19:58 +00:00
nobu 8090c2f214 * misc/ruby-mode.el (ruby-forward-string): forward a string. [new]
* misc/ruby-mode.el (ruby-parse-region): handle nested parentheses
  in a string and terminators in #{}.

* misc/ruby-mode.el (ruby-calculate-indent): ditto.

* misc/ruby-mode.el (ruby-font-lock-syntactic-keywords):
  fix font-lock problem [ruby-talk:29296].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-05 03:25:02 +00:00
nobu bb8805c9f8 * parse.y (yycompile): strdup()'ed twice.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-04 15:23:26 +00:00
matz 2c2694e846 * process.c (rb_f_system): abandon vfork.
* io.c (pipe_open): ditto.

* defines.h: sparc linux needs different FLUSH_REGISTER_WINDOWS

* regex.c (re_search): abandon stclass optimization.

* bignum.c (rb_cstr2inum): deny "0_".

* bignum.c (rb_cstr2inum): allow "0\n" and so on.

* error.c (rb_invalid_str): utility function to show inspect()'ed
  string.

* bignum.c (rb_cstr2inum): prints invalid strings in inspect()'ed
  format.

* object.c (rb_Float): ditto.

* object.c (rb_convert_type): no longer use rb_rescue().

* re.c (rb_reg_search): initialize taint status of match object.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-03 16:01:35 +00:00
eban 167dd9c933 * lib/mkmf.rb (create_makefile): add -I. to CPPFLAGS.
* lib/mkmf.rb (create_makefile): srcdir support(.def and depend file).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-02 14:42:01 +00:00
eban 7fa449a44a * ext/curses/extconf.rb: add dir_config.
* Makefile.in (fake.rb): set RUBY_VERSION.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-31 17:48:33 +00:00
nobu c891189693 * parse.y (yycompile): always store copy of filename.
* parse.y (rb_compile_file): no longer need to strdup() here.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-31 05:26:24 +00:00
aamine f3d9a0cc21 aamine
* lib/net/protocol.rb: Protocol#start returns the return value of block.
* lib/net/protocol.rb: set timeout limit by default.
* lib/net/protocol.rb: new methods WriteAdapter#write, puts, print, printf.
* lib/net/http.rb: rename HTTP#get2 to request_get, post2 to request_post ...
* lib/net/smtp.rb: should not resolve HELO domain automatically.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-30 19:18:45 +00:00
eban b8c26d48bc * ext/extmk.rb.in, lib/mkmf.rb (have_library): accept -lm
unconditionally on mswin32/mingw32.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-29 16:10:24 +00:00
nobu a59cf8edc5 * array.c (rb_cmpint): fixed typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-28 05:42:23 +00:00
nobu 3b4641a4bf * bignum.c (rb_cstr2inum): deny "0_".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-27 09:53:54 +00:00
nobu d0c78c8567 * bignum.c (rb_cstr2inum): allow "0\n" and so on.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-26 17:01:20 +00:00
akr cecb258bdf * lib/pp.rb, lib/prettyprint.rb: new files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-24 18:10:20 +00:00
matz 4282698219 * time.c (time_timeval): wrong cast to time_t.
* time.c (time_plus): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-22 16:58:16 +00:00
matz 0a45dee5a5 * parse.y (str_extend): make up "#$;" handling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-22 02:51:00 +00:00
matz 63b6b9c430 * time.c (time_plus): result should not be negative unless
NEGATIVE_TIME_T is defined.

* time.c (time_new_internal): should check tv_sec overflow too.

* time.c (time_timeval): should check time_t range when time is
  initialized from float.

* time.c (time_plus): uses modf(3).

* variable.c (rb_cvar_set): add frozen class/module check.

* variable.c (rb_cvar_declare): add frozen class/module check.

* re.c (match_to_a): should propagate taint.

* re.c (rb_reg_s_quote): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-21 09:23:28 +00:00
nobu e93b8f1c89 * dln.h, ruby.h, util.h: enable prototypes in C++.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-21 07:20:23 +00:00
nobu c29a112e14 * eval.c (rb_mod_define_method): must not convert Method to Proc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-20 18:19:42 +00:00
nobu b7a58b0650 * lib/mkmf.rb (with_destdir): new.
* lib/mkmf.rb: prefix target directories with $(DESTDIR) all.

* lib/mkmf.rb: no need to mkdir $(libdir)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-20 16:23:27 +00:00
aamine 5a4187f2c2 aamine
* lib/net/protocol.rb: rename Net::Socket to Net::BufferedSocket


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-20 05:00:20 +00:00
shugo a76e21e612 * ext/readline/readline.c: new methods
Readline::basic_word_break_characters,
	Readline::basic_word_break_characters=,
	Readline::completer_word_break_characters,
	Readline::completer_word_break_characters=,
	Readline::basic_quote_characters,
	Readline::basic_quote_characters=,
	Readline::completer_quote_characters,
	Readline::completer_quote_characters=,
	Readline::filename_quote_characters,
	Readline::filename_quote_characters=.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-19 08:02:55 +00:00
matz ee87eb1367 * eval.c (rb_mod_define_method): define_method should follow
default method visibility.

* eval.c (rb_attr): should warn if the default method visibility
  is "module_function" (can be error).

* eval.c (rb_mod_define_method): should define class/module method
  also if the visibility is "module_function".

* eval.c (rb_mod_define_method): should call hook method
  "method_added", and "singleton_method_added".

* string.c: use RESIZE_CAPA for capacity change.

* ext/socket/socket.c (Init_socket): add listen method to
  TCPServer and UNIXServer.

* ext/socket/socket.c (bsock_send): should raise EWOULDBLOCK
  exception.

* ext/socket/socket.c (s_recvfrom): ditto.

* ext/socket/socket.c (s_accept): ditto.

* ext/socket/socket.c (udp_send): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-19 07:48:32 +00:00
akr 8e8c76bd5f * lib/time.rb: date.rb is not required anymore.
* lib/resolv.rb: fix document.  refine IPv6 regex.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-18 18:14:08 +00:00
nobu ab34f43ae8 conflicted.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-18 09:37:34 +00:00
eban b487727ea4 * sample/test.rb: Hash#indexes -> Hash#select.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-18 08:56:51 +00:00
matz 35f851bcfe * string.c (rb_str_replace): swap arguments of OBJ_INFECT.
* eval.c (rb_thread_schedule): should not select a thread which is
  not yet initialized.

* time.c (time_plus): wrong boundary check.

* time.c (time_minus): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-18 08:47:06 +00:00
nobu cd956b3114 * intern.h: add prototypes.
rb_gc_enable(), rb_gc_disable(), rb_gc_start(), rb_str_new5()
  rb_str_buf_append(), rb_str_buf_cat(), rb_str_buf_cat2(),
  rb_str_dup_frozen()

* ruby.h: added declaration.
  rb_defout, rb_stdin, rb_stdout, rb_stderr, ruby_errinfo

* rubyio.h: changed double include guard macro to RUBYIO_H.

* array.c (inspect_call): make static.

* eval.c (dvar_asgn): ditto.

* io.c (rb_io_close_read): ditto.

* lex.c (rb_reserved_word): ditto.

* ruby.c: (req_list_head, req_list_last): ditto.

* ruby.c (require_libraries): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-17 07:52:35 +00:00
eban 4f8b1c8f64 2001-12-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-17 07:29:19 +00:00
akr bb6c116c63 * lib/time.rb: use Time#utc_offset.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-17 07:22:03 +00:00
akr b48e38c526 * time.c: new method `gmtoff', `gmt_offset' and `utc_offset'.
(time_utc_offset): new function.
(Init_Time): bind above methods to `time_utc_offset'.

* time.c: 64bit time_t support.
(time_s_at): use NUM2LONG instead of NUM2INT for tv_sec.
(time_arg): initialize tm_isdst correctly.
use long to initialize tm_year.
(search_time_t): renamed from `make_time_t'.
(make_time_t): call `timegm' and `mktime' instead of `search_time_t'
if availabe.
(time_to_i): use LONG2NUM instead of INT2NUM.
(time_localtime): check localtime failure.
(time_gmtime): check gmtime failure.
(time_year): use LONG2NUM instead of INT2FIX.
(time_to_a): use long for tm_year.
(time_dump): check tm_year which is not representable with 17bit.
(time_load): initialize tm_isdst.

* configure.in: check existence of `mktime' and `timegm'.
check existence of tm_gmtoff field of struct tm.
fix negative time_t for 64bit time_t.

* missing/strftime.c: fix overflow by tm_year + 1900.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-17 06:45:37 +00:00
aamine 39c0252e04 aamine
* lib/net/pop.rb: new method Net::POP3.APOP
* lib/net/http.rb: set default Content-Type to x-www-form-urlencoded (causes warning)
* lib/net/protocol.rb: remove Net::NetPrivate module.
* lib/net/smtp.rb: ditto.
* lib/net/pop.rb: ditto.
* lib/net/http.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-13 19:15:21 +00:00