summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-12 05:33:17 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-12 05:33:17 +0000
commitdb73cfedc4d6528eab067019ff1c5c7c76a8de01 (patch)
treea75cb3e5d2726f6b77b2dc25dbd3af7274ebf6b3
parent6d090b5ea478628ea765b9cc49db449c07aea365 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog131
-rw-r--r--eval.c3
-rw-r--r--hash.c6
-rw-r--r--io.c1
-rw-r--r--lib/finalize.rb6
-rw-r--r--regex.c1
-rw-r--r--string.c10
7 files changed, 99 insertions, 59 deletions
diff --git a/ChangeLog b/ChangeLog
index eb981ee82d..758f55bc90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,24 @@ Tue Sep 12 07:05:24 2000 Wakou Aoyama <[email protected]>
* lib/net/telnet.rb: version 1.6.0
+Mon Sep 11 14:24:47 2000 Yukihiro Matsumoto <[email protected]>
+
+ * hash.c (ruby_setenv): should not free the element of
+ origenvironment.
+
+Mon Sep 11 01:27:54 2000 Yukihiro Matsumoto <[email protected]>
+
+ * eval.c (massign): precise check for argument number.
+
+Thu Sep 7 14:17:51 2000 Yukihiro Matsumoto <[email protected]>
+
+ * string.c (rb_str_cat): should work even for concatenating same
+ string.
+
+Tue Sep 5 00:26:06 2000 Yukihiro Matsumoto <[email protected]>
+
+ * regex.c (re_search): range worked wrongly on bm_search().
+
Wed Aug 30 14:23:48 2000 WATANABE Hirofumi <[email protected]>
* ext/tcltklib/tcltklib.c: support --enable-tcltk_stubs
@@ -17,9 +35,16 @@ Wed Aug 30 11:31:47 2000 Nobuyoshi Nakada <[email protected]>
* ext/Win32API/Win32API.c (Win32API_initialize): add the
arguments checking.
+Wed Aug 30 10:29:40 2000 Masahiro Tomita <[email protected]>
+
+<<<<<<< ChangeLog
+ * io.c (rb_f_p): flush output buffer.
+
+=======
* ext/Win32API/Win32API.c (Win32API_initialize): add taint
checking. allow String object in the third argument.
+>>>>>>> 1.12.2.84
Tue Aug 29 15:18:20 2000 Yukihiro Matsumoto <[email protected]>
* ruby.c (proc_options): the value of -K may be empty.
@@ -1164,7 +1189,7 @@ Fri Sep 3 11:14:31 1999 Yukihiro Matsumoto <[email protected]>
* compar.c (cmp_equal): should not raise exception; protect by
rb_rescue().
-Thu Sep 2 05:23:05 1999 WATANABE Hirofumi <[email protected]>
+Thu Sep 2 05:23:05 1999 WATANABE Hirofumi <[email protected]>
* file.c (rb_file_s_expand_path): use dirsep, instead of character
literal '/'.
@@ -1199,7 +1224,7 @@ Wed Sep 1 00:28:27 1999 Yukihiro Matsumoto <[email protected]>
Fri Aug 28 17:32:55 1999 Yasuhiro Fukuma <[email protected]>
* eval.c (rb_eval): should set return value (nil) explicitly if a
- value is ommited for return statement.
+ value is omitted for return statement.
Thu Aug 26 15:06:11 1999 Masaki Fukushima <[email protected]>
@@ -1224,7 +1249,7 @@ Fri Aug 20 20:50:58 1999 Kenji Nagasawa <[email protected]>
Thu Aug 19 10:50:43 1999 WATANABE Tetsuya <[email protected]>
- * gc.c (rb_gc): add volatile to avoid GCC optimaize bug(?).
+ * gc.c (rb_gc): add volatile to avoid GCC optimize bug(?).
Wed Aug 18 23:48:10 1999 Yukihiro Matsumoto <[email protected]>
@@ -1239,7 +1264,7 @@ Fri Aug 13 15:41:39 1999 Yukihiro Matsumoto <[email protected]>
Fri Aug 13 03:16:07 1999 Yukihiro Matsumoto <[email protected]>
* io.c (argf_forward): since $stdout may be non-IO, ARGF.file is
- not granteed to be IO. check and forwarding added to every ARGF
+ not guaranteed to be IO. check and forwarding added to every ARGF
method.
* io.c (set_outfile): $stdout/$stderr may not be IO now.
@@ -1379,7 +1404,7 @@ Fri Jul 30 02:11:48 1999 Yukihiro Matsumoto <[email protected]>
* io.c (rb_io_fptr_close): do not call rb_sys_wait() on finalize.
- * eval.c (yield_under_i): cbase context should be maintaind for
+ * eval.c (yield_under_i): cbase context should be maintained for
Module#module_eval(). suggested by <[email protected]>.
Wed Jul 28 01:18:28 1999 WATANABE Hirofumi <[email protected]>
@@ -1418,7 +1443,7 @@ Fri Jul 23 02:49:49 1999 Yukihiro Matsumoto <[email protected]>
Thu Jul 22 19:37:22 1999 Yukihiro Matsumoto <[email protected]>
- * eval.c (rb_thread_join): get_backtrace() may retrun Qnil.
+ * eval.c (rb_thread_join): get_backtrace() may return Qnil.
typecheck added.
Tue Jul 20 14:36:43 1999 WATANABE Hirofumi <[email protected]>
@@ -1469,7 +1494,7 @@ Fri Jul 16 10:58:22 1999 WATANABE Tetsuya <[email protected]>
Fri Jul 16 09:58:15 1999 Katsuyuki Komatsu <[email protected]>
- * many files: clean up unsed variables found by gcc -Wall.
+ * many files: clean up unused variables found by gcc -Wall.
* lib/mkmf.rb: better cygwin support etc.
@@ -1801,7 +1826,7 @@ Fri Jun 11 23:27:00 1999 Tadayoshi Funaba <[email protected]>
Fri Jun 11 15:21:21 1999 Yukihiro Matsumoto <[email protected]>
- * gc.c (rb_gc_mark_locations): add safty margin 1.
+ * gc.c (rb_gc_mark_locations): add safety margin 1.
* eval.c (ruby_run): should protect toplevel node tree.
@@ -1810,7 +1835,7 @@ Fri Jun 11 15:21:21 1999 Yukihiro Matsumoto <[email protected]>
Fri Jun 11 01:50:25 1999 Yukihiro Matsumoto <[email protected]>
* eval.c (ruby_run): Init_stack() was called too late; local
- variables happend to be higher (or lower) than stack_start.
+ variables happened to be higher (or lower) than stack_start.
Thu Jun 10 16:41:48 1999 Yukihiro Matsumoto <[email protected]>
@@ -1915,7 +1940,7 @@ Tue Jun 1 15:29:33 1999 Yukihiro Matsumoto <[email protected]>
* eval.c (module_setup): need to add PUSH_VAR/POP_VAR to clear
dyna vars link list.
- * version.h (RUBY_RELEASE_CODE): integer macro contant for source
+ * version.h (RUBY_RELEASE_CODE): integer macro constant for source
version detection.
Sun May 30 22:19:12 1999 Kenji Nagasawa <[email protected]>
@@ -1968,7 +1993,7 @@ Fri May 28 17:16:49 1999 Yukihiro Matsumoto <[email protected]>
* ext/socket/socket.c (setipaddr): re-wrote using ip_addrsetup().
- * ext/sockt/socket.c (ip_addrsetup): decode symbolic address
+ * ext/socket/socket.c (ip_addrsetup): decode symbolic address
<broadcast>.
Thu May 27 12:27:42 1999 Yukihiro Matsumoto <[email protected]>
@@ -2157,7 +2182,7 @@ Fri May 7 08:17:19 1999 Yukihiro Matsumoto <[email protected]>
Fri May 7 01:42:20 1999 Yukihiro Matsumoto <[email protected]>
- * ext/socket/socket.c (tcp_s_gethostbyname): aboid using struct
+ * ext/socket/socket.c (tcp_s_gethostbyname): avoid using struct
sockaddr_storage.
Thu May 6 13:21:41 1999 Yukihiro Matsumoto <[email protected]>
@@ -2166,7 +2191,7 @@ Thu May 6 13:21:41 1999 Yukihiro Matsumoto <[email protected]>
Thu May 4 12:34:18 1999 Koji Arai <[email protected]>
- * parse.y (parse_string): there shuould be newline escape by
+ * parse.y (parse_string): there should be newline escape by
backslashes in strings.
* parse.y (parse_qstring): ditto.
@@ -2286,7 +2311,7 @@ Tue Apr 20 02:32:42 1999 Yukihiro Matsumoto <[email protected]>
* re.c (rb_reg_desc): did not print options properly.
- * io.c (rb_file_s_open): intialize was called twice.
+ * io.c (rb_file_s_open): initialize was called twice.
Mon Apr 19 18:56:21 1999 Yukihiro Matsumoto <[email protected]>
@@ -2413,7 +2438,7 @@ Wed Mar 24 13:06:43 1999 Yukihiro Matsumoto <[email protected]>
* io.c (next_argv): need to check type for ARGV.shift.
- * eval.c (blk_copy_prev): need to preverse outer scope as well as
+ * eval.c (blk_copy_prev): need to preserve outer scope as well as
outer frames.
* parse.y (rb_compile_string): return can appear within eval().
@@ -2531,7 +2556,7 @@ Fri Mar 12 02:12:50 1999 Yukihiro Matsumoto <[email protected]>
Thu Mar 11 18:23:50 1999 WATANABE Tetsuya <[email protected]>
- * ext/socket/socket.c (Init_socket): UDPsocket was ommited.
+ * ext/socket/socket.c (Init_socket): UDPsocket was omitted.
Thu Mar 11 16:43:30 1999 Yukihiro Matsumoto <[email protected]>
@@ -2610,8 +2635,8 @@ Tue Mar 2 17:04:19 1999 Yukihiro Matsumoto <[email protected]>
Mon Mar 1 14:05:12 1999 Yukihiro Matsumoto <[email protected]>
* eval.c (rb_call0): adjust argv for optional arguments. super
- without arguments emit superclasse method with the value from
- optinal arguments. enabled as experiment.
+ without arguments emit superclass method with the value from
+ optional arguments. enabled as experiment.
Sun Feb 28 14:04:07 1999 WATANABE Hirofumi <[email protected]>
@@ -2699,9 +2724,9 @@ Tue Feb 23 14:21:41 1999 Yukihiro Matsumoto <[email protected]>
Tue Feb 23 12:32:41 1999 WATANABE Hirofumi <[email protected]>
- * eval.c (rb_load): tilde expandion moved to find_file.
+ * eval.c (rb_load): tilde expansion moved to find_file.
- * eval.c (find_file): tilde expandion added.
+ * eval.c (find_file): tilde expansion added.
Tue Feb 23 10:50:20 1999 Yukihiro Matsumoto <[email protected]>
@@ -2748,18 +2773,18 @@ Fri Feb 19 00:25:57 1999 Yukihiro Matsumoto <[email protected]>
* time.c (time_plus): Time#+ should not receive Time object
operand.
- * string.c (rb_str_substr): nagative length raises exception now.
+ * string.c (rb_str_substr): negative length raises exception now.
* array.c (beg_len): if end == -1, it points end of the array.
- * array.c (rb_ary_subseq): nagative length raises exception now.
+ * array.c (rb_ary_subseq): negative length raises exception now.
Thu Feb 18 20:57:04 1999 Tadayoshi Funaba <[email protected]>
* time.c (rb_strftime): strftime() may return 0 on success too.
- * time.c (time_strftime): `\0' within format string shoule not be
- ommited in the result.
+ * time.c (time_strftime): `\0' within format string should not be
+ omitted in the result.
* time.c (rb_strftime): zero length format.
@@ -2827,7 +2852,7 @@ Mon Feb 15 11:43:22 1999 GOTO Kentaro <[email protected]>
Sun Feb 14 22:36:40 1999 EGUCHI Osamu <[email protected]>
- * sprintf.c (rb_f_sprintf): `%G' was ommited.
+ * sprintf.c (rb_f_sprintf): `%G' was omitted.
Sun Feb 14 12:47:48 1999 EGUCHI Osamu <[email protected]>
@@ -2836,7 +2861,7 @@ Sun Feb 14 12:47:48 1999 EGUCHI Osamu <[email protected]>
* numeric.c (Init_Numeric): FloatDomainError added.
* configure.in (AC_REPLACE_FUNCS): add checks for functions
- insinf, isnan, and finite.
+ isinf, isnan, and finite.
Sat Feb 13 01:24:16 1999 Yukihiro Matsumoto <[email protected]>
@@ -2910,7 +2935,7 @@ Sat Feb 6 22:56:21 1999 Yukihiro Matsumoto <[email protected]>
Sat Feb 6 03:06:17 1999 Yukihiro Matsumoto <[email protected]>
- * re.c (match_getter): accessng $~ without matching caused SEGV.
+ * re.c (match_getter): accessing $~ without matching caused SEGV.
Fri Feb 5 22:11:08 1999 EGUCHI Osamu <[email protected]>
@@ -2942,7 +2967,7 @@ Thu Feb 4 11:56:24 1999 Yukihiro Matsumoto <[email protected]>
* configure.in (strtod): add strtod compatible check.
- * numeric.c (rb_num2long): missing/vsnprintf.c does not supprt
+ * numeric.c (rb_num2long): missing/vsnprintf.c does not support
floating points.
* numeric.c (flo_to_s): ditto.
@@ -2982,7 +3007,7 @@ Wed Feb 3 15:03:16 1999 Yukihiro Matsumoto <[email protected]>
Tue Feb 2 17:11:26 1999 WATANABE Tetsuya <[email protected]>
- * string.c (rb_str_gsub_bang): too small realoc condition.
+ * string.c (rb_str_gsub_bang): too small realloc condition.
Mon Feb 1 10:01:17 1999 EGUCHI Osamu <[email protected]>
@@ -2999,7 +3024,7 @@ Sat Jan 30 08:45:16 1999 IKARASHI Akira <[email protected]>
Sat Jan 30 13:38:24 1999 Yukihiro Matsumoto <[email protected]>
* regex.c (re_compile_pattern): mbchars should match with \w
- within character classs. Was matching with \W.
+ within character class. Was matching with \W.
* regex.c (re_match): \w should match with multi byte characters,
not its first byte.
@@ -3075,7 +3100,7 @@ Wed Jan 20 03:39:48 1999 Yukihiro Matsumoto <[email protected]>
* parse.y (yycompile): rb_in_compile renamed to ruby_in_compile.
- * ruby.c (load_file): define DATA iff __END__ appeared in script.
+ * ruby.c (load_file): define DATA if __END__ appeared in script.
Tue Jan 19 14:57:51 1999 Yukihiro Matsumoto <[email protected]>
@@ -3212,7 +3237,7 @@ Thu Dec 24 00:17:00 1998 Yukihiro Matsumoto <[email protected]>
* eval.c (rb_load): top self should be set properly.
- * variable.c (classname): check __classpath__ iff it is defined.
+ * variable.c (classname): check __classpath__ if it is defined.
* variable.c (classname): invalid warning at -v with static linked
ruby interpreter.
@@ -3296,7 +3321,7 @@ Mon Dec 7 22:08:22 1998 Yukihiro Matsumoto <[email protected]>
Mon Dec 7 18:24:50 1998 WATANABE Tetsuya <[email protected]>
- * ruby.c (set_arg0): $0 supprt for HP-UX.
+ * ruby.c (set_arg0): $0 support for HP-UX.
Mon Dec 7 01:30:28 1998 WATANABE Hirofumi <[email protected]>
@@ -3459,7 +3484,7 @@ Wed Nov 11 10:54:57 1998 Yukihiro Matsumoto <[email protected]>
Tue Nov 10 00:22:11 1998 EGUCHI Osamu <[email protected]>
- * configure.in: elf supprt for FreeBSD 3.x
+ * configure.in: elf support for FreeBSD 3.x
Tue Nov 10 00:05:43 1998 Yukihiro Matsumoto <[email protected]>
@@ -3590,7 +3615,7 @@ Fri Oct 16 15:31:45 1998 Yukihiro Matsumoto <[email protected]>
Thu Oct 15 13:54:48 1998 Yukihiro Matsumoto <[email protected]>
- * parse.y (arg): local variabls can be accessed within right side
+ * parse.y (arg): local variables can be accessed within right side
expression in assignment, notably in blocks.
Wed Oct 14 00:18:33 1998 Yukihiro Matsumoto <[email protected]>
@@ -3704,7 +3729,7 @@ Mon Sep 14 14:42:27 1998 Yukihiro Matsumoto <[email protected]>
* regex.c (re_match): beginning and end of the string, do not
automatically match `\b'.
- * string.c (scan_once): comsume at leaset on character.
+ * string.c (scan_once): consume at least on character.
* regex.c (re_search): wrong behavior for negative range.
@@ -4032,7 +4057,7 @@ Fri Jul 3 11:20:46 1998 Yukihiro Matsumoto <[email protected]>
* numeric.c (fix_mul): use FIX2LONG() instead of FIX2INT() for
64bit architectures.
- * marshal.c (r_bytes): remove weird casting bwetween pointer and int.
+ * marshal.c (r_bytes): remove weird casting between pointer and int.
* process.c (proc_setsid): new method Process#setsid().
@@ -4491,7 +4516,7 @@ Tue Apr 28 00:07:38 1998 Yukihiro Matsumoto <[email protected]>
Mon Apr 27 16:59:17 1998 Yukihiro Matsumoto <[email protected]>
* ext/gtk/gtk.c (Init_gtk): use timeout, not idle to avoid
- comsuming CPU too much.
+ consuming CPU too much.
* lib/tk.rb: use tcltklib#_invoke instead of `_eval'.
@@ -4832,7 +4857,7 @@ Tue Mar 31 13:23:58 1998 Yukihiro Matsumoto <[email protected]>
Mon Mar 30 11:12:29 1998 Yukihiro Matsumoto <[email protected]>
- * file.c (f_test): raises exception for unkown command.
+ * file.c (f_test): raises exception for unknown command.
* eval.c (Init_eval): `class_eval': alias to the module_eval.
@@ -4949,7 +4974,7 @@ Wed Mar 18 17:46:31 1998 Yukihiro Matsumoto <[email protected]>
* ruby.c (load_file): new file object constant DATA. Only
available for the script from the file.
- * regex.c (re_match): forwading failure point popped too much.
+ * regex.c (re_match): forwarding failure point popped too much.
Tue Mar 17 18:23:06 1998 Yukihiro Matsumoto <[email protected]>
@@ -5064,7 +5089,7 @@ Fri Mar 6 17:23:07 1998 Yukihiro Matsumoto <[email protected]>
primitive classes (mostly perfect).
* ext/curses/curses.c (curses_finalize): restore original state at
- interpreter temination.
+ interpreter termination.
* ext/curses/curses.c (curses_addstr): forgot to check argument
type (caused SEGV). now uses STR2CSTR() macro.
@@ -5108,7 +5133,7 @@ Tue Mar 3 11:21:28 1998 Yukihiro Matsumoto <[email protected]>
Tue Mar 3 08:04:56 1998 Tadayoshi Funaba <[email protected]>
- * struct.c (struct_alloc): imcomplete struct initialization made
+ * struct.c (struct_alloc): incomplete struct initialization made
GC to access unallocated addresses.
Mon Mar 2 16:28:27 1998 Yukihiro Matsumoto <[email protected]>
@@ -5278,7 +5303,7 @@ Tue Feb 10 17:29:08 1998 Yukihiro Matsumoto <[email protected]>
* string.c (str_oct): does recognize `0x'.
- * sprintf.c (f_sprintf): use baes 10 for conversion from string to
+ * sprintf.c (f_sprintf): use base 10 for conversion from string to
integer.
Mon Feb 9 14:51:56 1998 Yukihiro Matsumoto <[email protected]>
@@ -5479,7 +5504,7 @@ Tue Jan 6 00:27:43 1998 Yukihiro Matsumoto <[email protected]>
Mon Jan 5 16:59:13 1998 WATANABE Hirofumi <[email protected]>
- * file.c (file_s_basename): removes any extention by ".*".
+ * file.c (file_s_basename): removes any extension by ".*".
Sun Jan 4 19:36:22 1998 WATANABE Hirofumi <[email protected]>
@@ -5617,7 +5642,7 @@ Fri Dec 12 00:50:25 1997 Yukihiro Matsumoto <[email protected]>
* eval.c (rb_eval): new visibility status `function'.
- * parse.y (yycompile): do not clear eval_tree. thus enable multipe
+ * parse.y (yycompile): do not clear eval_tree. thus enable multiple
command line script by option `-e'.
* eval.c (rb_eval): END execute just once.
@@ -5698,7 +5723,7 @@ Mon Dec 1 15:24:41 1997 Yukihiro Matsumoto <[email protected]>
Wed Nov 26 18:18:05 1997 Yukihiro Matsumoto <[email protected]>
- * lib/mkmf.rb: generate Makefile for extention modules out of ruby
+ * lib/mkmf.rb: generate Makefile for extension modules out of ruby
source tree. use like `ruby -r mkmf extconf.rb'.
* numeric.c (fix2str): enlarge buffer to prevent overflow on some
@@ -5896,7 +5921,7 @@ Fri Oct 3 10:51:10 1997 Yukihiro Matsumoto <[email protected]>
* eval.c (ruby_options): f_require() called too early.
- * eval.c (rb_provide): module extentions should always be `.o'.
+ * eval.c (rb_provide): module extensions should always be `.o'.
Thu Oct 2 11:38:31 1997 Yukihiro Matsumoto <[email protected]>
@@ -6092,7 +6117,7 @@ Mon Sep 1 13:42:48 1997 Yukihiro Matsumoto <[email protected]>
* class.c (rb_define_attr): always defines accessors.
- * eval.c (rb_call): alias occured in the module body caused SEGV.
+ * eval.c (rb_call): alias occurred in the module body caused SEGV.
* parse.y: did not generate here document strings properly.
@@ -6111,7 +6136,7 @@ Fri Aug 29 11:10:21 1997 Yukihiro Matsumoto <[email protected]>
unnamed fundamental classes, such as Object, String, etc.
* variable.c (rb_name_class): can't name class before String class
- is initilialized.
+ is initialized.
* inits.c (rb_call_inits): unrecognized dependency from GC to
Array.
@@ -6145,7 +6170,7 @@ Wed Aug 27 11:32:42 1997 Yukihiro Matsumoto <[email protected]>
* variable.c (fc_i): some classes/modules does not have iv_tbl.
- * variable.c (find_class_path): avoid inifinite loop.
+ * variable.c (find_class_path): avoid infinite loop.
Tue Aug 26 13:43:47 1997 Yukihiro Matsumoto <[email protected]>
@@ -6162,7 +6187,7 @@ Tue Aug 26 13:43:47 1997 Yukihiro Matsumoto <[email protected]>
* object.c (Init_Object): superclass()'s method argument setting
was wrong again.
- * class.c (mod_anscestors): list superclasses and included modules
+ * class.c (mod_ancestors): list superclasses and included modules
in priority order.
Mon Aug 25 11:53:11 1997 Yukihiro Matsumoto <[email protected]>
@@ -6177,7 +6202,7 @@ Mon Aug 25 11:53:11 1997 Yukihiro Matsumoto <[email protected]>
Sat Aug 23 21:39:05 1997 Yukihiro Matsumoto <[email protected]>
- * parse.y (asignable): remove unnecessary local variable
+ * parse.y (assignable): remove unnecessary local variable
initialize by nil.
Fri Aug 22 14:26:40 1997 Yukihiro Matsumoto <[email protected]>
@@ -6242,7 +6267,7 @@ Fri Aug 15 15:49:46 1997 Yukihiro Matsumoto <[email protected]>
* eval.c (call_trace_func): block context switch in the trace
function.
- * eval.c (rb_eval): clear method cache at class extention.
+ * eval.c (rb_eval): clear method cache at class extension.
* object.c (obj_type): returns object's class even if it defines
singleton methods.
diff --git a/eval.c b/eval.c
index b708fa49d7..c1403ab5b4 100644
--- a/eval.c
+++ b/eval.c
@@ -3354,6 +3354,9 @@ massign(self, node, val, check)
assign(self, node->nd_args, rb_ary_new2(0), check);
}
}
+ else if (check && i < len) {
+ goto arg_error;
+ }
while (list) {
i++;
diff --git a/hash.c b/hash.c
index 20865bcec3..f16160c57f 100644
--- a/hash.c
+++ b/hash.c
@@ -1091,7 +1091,8 @@ ruby_setenv(name, value)
environ = tmpenv; /* tell exec where it is now */
}
if (!value) {
- free(environ[i]);
+ if (environ[i] != origenviron[i])
+ free(environ[i]);
while (environ[i]) {
environ[i] = environ[i+1];
i++;
@@ -1103,7 +1104,8 @@ ruby_setenv(name, value)
environ[i+1] = 0; /* make sure it's null terminated */
}
else {
- free(environ[i]);
+ if (environ[i] != origenviron[i])
+ free(environ[i]);
}
environ[i] = ALLOC_N(char, strlen(name) + strlen(value) + 2);
#ifndef MSDOS
diff --git a/io.c b/io.c
index b14e617749..b2f6b81444 100644
--- a/io.c
+++ b/io.c
@@ -2048,6 +2048,7 @@ rb_f_p(argc, argv)
for (i=0; i<argc; i++) {
rb_p(argv[i]);
}
+ fflush(stdout);
return Qnil;
}
diff --git a/lib/finalize.rb b/lib/finalize.rb
index 3cf79ff92f..598569f52e 100644
--- a/lib/finalize.rb
+++ b/lib/finalize.rb
@@ -32,7 +32,7 @@
# finalize all dependants connected by dependency R_*(obj, dependtant).
# finalize_by_dependant(dependant, method = :finalize)
# finalize the dependant connected by dependency R_method(*, dependtant).
-# fainalize_all_by_dependant(dependant)
+# finalize_all_by_dependant(dependant)
# finalize all dependants connected by dependency R_*(*, dependant).
# finalize_all
# finalize all dependency registered to the Finalizer.
@@ -138,7 +138,7 @@ module Finalizer
end
# finalize all dependants connected by dependency R_*(*, dependtant)
- def fainalize_all_by_dependant(dependant)
+ def finalize_all_by_dependant(dependant)
for id in @dependency.keys
finalize_all_dependency(id, dependant)
end
@@ -190,7 +190,7 @@ module Finalizer
module_function :finalize_dependency
module_function :finalize_all_dependency
module_function :finalize_by_dependant
- module_function :fainalize_all_by_dependant
+ module_function :finalize_all_by_dependant
module_function :finalize_all
module_function :safe
diff --git a/regex.c b/regex.c
index c0b8676645..91bbecad4f 100644
--- a/regex.c
+++ b/regex.c
@@ -3063,6 +3063,7 @@ re_search(bufp, string, size, startpos, range, regs)
if (range > 0 && (bufp->options & RE_OPTIMIZE_EXACTN)) {
startpos += pos;
range -= pos;
+ if (range < 0) return -1;
}
}
diff --git a/string.c b/string.c
index b4e133049a..74235cfbcf 100644
--- a/string.c
+++ b/string.c
@@ -403,10 +403,18 @@ rb_str_cat(str, ptr, len)
long len;
{
if (len > 0) {
+ int poffset = -1;
+
rb_str_modify(str);
+ if (RSTRING(str)->ptr <= ptr &&
+ ptr < RSTRING(str)->ptr + RSTRING(str)->len) {
+ poffset = ptr - RSTRING(str)->ptr;
+ }
REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len + len + 1);
- if (ptr)
+ if (ptr) {
+ if (poffset >= 0) ptr = RSTRING(str)->ptr + poffset;
memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len);
+ }
RSTRING(str)->len += len;
RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; /* sentinel */
}