Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* string.c (rb_str_index): wrong increment for non alphanumeric

  string.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit b0d7895cab3ef8b405c9cf271e5e82f8dcf9258e 1 parent 144fb05
matz authored
5 ChangeLog
@@ -3,6 +3,11 @@ Tue Oct 16 00:07:06 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
3 3 * parse.y (yylex): disallow alpha-numeric and mbchar for
4 4 terminator of %string.
5 5
  6 +Mond Oct 15 18:00:05 2001 Pit Capitain <pit@capitain.de>
  7 +
  8 + * string.c (rb_str_index): wrong increment for non alphanumeric
  9 + string.
  10 +
6 11 Wed Oct 10 03:11:47 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
7 12
8 13 * file.c (rb_stat_clone): should copy internal data too.
9 ToDo
... ... @@ -1,5 +1,6 @@
1 1 Language Spec.
2 2
  3 +- Class#allocate - basicNew
3 4 * operator !! for rescue. ???
4 5 * objectify characters
5 6 * ../... outside condition invokes operator method too.
@@ -25,11 +26,13 @@ Language Spec.
25 26 * unify == and eql? again
26 27 * to_i returns nil if str contains no digit.
27 28 * raise exception by `` error
28   -* jar like combined library package.
  29 +* jar like combined library package. -> RubyGems?
29 30 * resumable Exception via Exception#resume.
30 31 * method combination, e.g. before, after, around, etc.
31 32 * .. or something like defadvice in Emacs.
32   -* Class#allocate - basicNew
  33 +* property - for methods, or for objects in general.
  34 +* in modifier, to annotate, or to encourage assertion.
  35 +* selector namespace - something like generic-flet in CLOS, to help RubyBehevior
33 36
34 37 Hacking Interpreter
35 38
@@ -49,6 +52,7 @@ Hacking Interpreter
49 52 * warn for inconsistent local variable usage (lv m and method m at the same time).
50 53 * MicroRuby
51 54 * Built-in Interactive Ruby.
  55 +* Parser API
52 56 * trap every method invocation, which can be enabled by e.g. trap_call :method.
53 57 * unify Errno exceptions of same errno, or new exception comparison scheme.
54 58 * 2.times{|i| if i==0 then a = 15 else puts eval("a") end} should print nil.
@@ -89,6 +93,7 @@ Standard Libraries
89 93 * warning framework (warn, warning for Ruby level)
90 94 * marshal should not depend on sprintf/strtod (works bad for locale).
91 95 * ternary arg pow: a.pow(b,c) == a**b%c
  96 +* new caller(), e.g. call_stack; needs better name.
92 97
93 98 Extension Libraries
94 99
34 array.c
@@ -86,10 +86,11 @@ rb_ary_s_alloc(klass)
86 86 }
87 87
88 88 VALUE
89   -rb_ary_new2(len)
  89 +rb_ary_new0(klass, len)
  90 + VALUE klass;
90 91 long len;
91 92 {
92   - VALUE ary = rb_obj_alloc(rb_cArray);
  93 + VALUE ary = rb_obj_alloc(klass);
93 94
94 95 if (len < 0) {
95 96 rb_raise(rb_eArgError, "negative array size (or size too big)");
@@ -105,6 +106,14 @@ rb_ary_new2(len)
105 106 }
106 107
107 108 VALUE
  109 +rb_ary_new2(len)
  110 + long len;
  111 +{
  112 + return rb_ary_new0(rb_cArray, len);
  113 +}
  114 +
  115 +
  116 +VALUE
108 117 rb_ary_new()
109 118 {
110 119 return rb_ary_new2(ARY_DEFAULT_SIZE);
@@ -408,7 +417,7 @@ rb_ary_subseq(ary, beg, len)
408 417 VALUE ary;
409 418 long beg, len;
410 419 {
411   - VALUE ary2;
  420 + VALUE klass, ary2;
412 421
413 422 if (beg > RARRAY(ary)->len) return Qnil;
414 423 if (beg < 0 || len < 0) return Qnil;
@@ -419,12 +428,12 @@ rb_ary_subseq(ary, beg, len)
419 428 if (len < 0) {
420 429 len = 0;
421 430 }
422   - if (len == 0) return rb_ary_new2(0);
  431 + klass = rb_obj_class(ary);
  432 + if (len == 0) return rb_ary_new0(klass,0);
423 433
424   - ary2 = rb_ary_new2(len);
  434 + ary2 = rb_ary_new0(klass, len);
425 435 MEMCPY(RARRAY(ary2)->ptr, RARRAY(ary)->ptr+beg, VALUE, len);
426 436 RARRAY(ary2)->len = len;
427   - RBASIC(ary2)->klass = rb_obj_class(ary);
428 437
429 438 return ary2;
430 439 }
@@ -1218,6 +1227,15 @@ rb_ary_reject_bang(ary)
1218 1227 }
1219 1228
1220 1229 static VALUE
  1230 +rb_ary_reject(ary)
  1231 + VALUE ary;
  1232 +{
  1233 + ary = rb_ary_dup(ary);
  1234 + rb_ary_reject_bang(ary);
  1235 + return ary;
  1236 +}
  1237 +
  1238 +static VALUE
1221 1239 rb_ary_delete_if(ary)
1222 1240 VALUE ary;
1223 1241 {
@@ -1340,14 +1358,13 @@ rb_ary_times(ary, times)
1340 1358 }
1341 1359 len *= RARRAY(ary)->len;
1342 1360
1343   - ary2 = rb_ary_new2(len);
  1361 + ary2 = rb_ary_new0(rb_obj_class(ary), len);
1344 1362 RARRAY(ary2)->len = len;
1345 1363
1346 1364 for (i=0; i<len; i+=RARRAY(ary)->len) {
1347 1365 MEMCPY(RARRAY(ary2)->ptr+i, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
1348 1366 }
1349 1367 OBJ_INFECT(ary2, ary);
1350   - RBASIC(ary2)->klass = rb_obj_class(ary);
1351 1368
1352 1369 return ary2;
1353 1370 }
@@ -1760,6 +1777,7 @@ Init_Array()
1760 1777 rb_define_method(rb_cArray, "delete", rb_ary_delete, 1);
1761 1778 rb_define_method(rb_cArray, "delete_at", rb_ary_delete_at_m, 1);
1762 1779 rb_define_method(rb_cArray, "delete_if", rb_ary_delete_if, 0);
  1780 + rb_define_method(rb_cArray, "reject", rb_ary_reject, 0);
1763 1781 rb_define_method(rb_cArray, "reject!", rb_ary_reject_bang, 0);
1764 1782 rb_define_method(rb_cArray, "replace", rb_ary_replace, 1);
1765 1783 rb_define_method(rb_cArray, "clear", rb_ary_clear, 0);
4 io.c
@@ -1231,10 +1231,6 @@ rb_io_sysread(io, len)
1231 1231
1232 1232 n = fileno(fptr->f);
1233 1233 rb_thread_wait_fd(fileno(fptr->f));
1234   - if (fptr->f == 0) {
1235   - fprintf(stderr, "bingo\n");
1236   - exit(1);
1237   - }
1238 1234 TRAP_BEG;
1239 1235 n = read(fileno(fptr->f), RSTRING(str)->ptr, RSTRING(str)->len);
1240 1236 TRAP_END;
2  lib/complex.rb
@@ -290,7 +290,7 @@ def to_s
290 290 end
291 291
292 292 def hash
293   - @real ^ @image
  293 + @real.hash ^ @image.hash
294 294 end
295 295
296 296 def inspect
2  misc/ruby-mode.el
@@ -137,7 +137,7 @@
137 137 (ruby-mark-defun)
138 138 (save-restriction
139 139 (narrow-to-region (region-beginning) (region-end))
140   - (while (re-search-forward "^\\s *def\\s *\\([^(\n ]+\\)" nil t)
  140 + (while (re-search-forward "^\\s *def\\s *\\([^(\n ]+\\)" nil 'move)
141 141 (setq method-begin (match-beginning 1))
142 142 (setq method-name (buffer-substring method-begin (match-end 1)))
143 143 (push (cons (concat class-name "#" method-name) (match-beginning 0)) index-alist))))
4 object.c
@@ -595,7 +595,9 @@ rb_mod_initialize(argc, argv, module)
595 595 VALUE *argv;
596 596 VALUE module;
597 597 {
598   - rb_mod_module_eval(0, 0, module);
  598 + if (rb_block_given_p()) {
  599 + rb_mod_module_eval(0, 0, module);
  600 + }
599 601 return Qnil;
600 602 }
601 603
4 string.c
@@ -1011,8 +1011,8 @@ rb_str_succ(orig)
1011 1011 sbeg = RSTRING(str)->ptr; s = sbeg + RSTRING(str)->len - 1;
1012 1012 c = '\001';
1013 1013 while (sbeg <= s) {
1014   - *s += 1;
1015   - if (*s-- != 0) break;
  1014 + if ((*s += 1) != 0) break;
  1015 + s--;
1016 1016 }
1017 1017 }
1018 1018 if (s < sbeg) {
4 version.h
... ... @@ -1,4 +1,4 @@
1 1 #define RUBY_VERSION "1.7.1"
2   -#define RUBY_RELEASE_DATE "2001-10-15"
  2 +#define RUBY_RELEASE_DATE "2001-10-16"
3 3 #define RUBY_VERSION_CODE 171
4   -#define RUBY_RELEASE_CODE 20011015
  4 +#define RUBY_RELEASE_CODE 20011016

0 comments on commit b0d7895

Please sign in to comment.
Something went wrong with that request. Please try again.