[#7055] More on VC++ 2005 — Austin Ziegler <halostatue@...>

Okay. I've got Ruby compiling. I'm attempting to get everything in

17 messages 2006/01/05
[#7058] Re: More on VC++ 2005 — nobuyoshi nakada <nobuyoshi.nakada@...> 2006/01/06

Hi,

[#7084] mathn: ugly warnings — hadmut@... (Hadmut Danisch)

Hi,

22 messages 2006/01/10
[#7097] Re: mathn: ugly warnings — Daniel Berger <Daniel.Berger@...> 2006/01/10

Hadmut Danisch wrote:

[#7098] Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/10

Daniel Berger wrote:

[#7118] Re: Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/12

*Dean Wampler *<deanwampler gmail.com> writes:

[#7226] Fwd: Re: Question about massive API changes — "Sean E. Russell" <ser@...>

Hello,

23 messages 2006/01/28
[#7228] Re: Question about massive API changes — Caleb Tennis <caleb@...> 2006/01/28

>

Re: [PATCH] Clarify String#scan Documentation (was Re: [ ruby-Bugs-3329 ] String#scan loops forefever if scanned string is modified inside block.)

From: nobu@...
Date: 2006-01-27 01:33:09 UTC
List: ruby-core #7222
Hi,

At Fri, 27 Jan 2006 01:58:12 +0900,
Paul Duncan wrote in [ruby-core:07220]:
> Most people would expect ['a', 'b', 'c, 'e', 'f'] there.  This could be
> "fixed" in a a couple of ways:
> 
> * Raise an exception if the receiver is modified during a scan (I don't
>   really like this option).
> * Attempt to hack in offset adjustment into string modification.  The
>   functions in question are rb_str_splice() and rb_str_aref(), although
>   I haven't investigated fully, so there may be other methods as well.
>   This is really my least-favorite option, because it doesn't handle the
>   case where someone modifies the receiver while keeping the length the
>   same.
> * Leave things as they are and add a big warning to the String#scan
>   documentation.  Personally, I prefer this option.

* Scan frozen shared string.


Index: string.c
===================================================================
RCS file: /cvs/ruby/src/ruby/string.c,v
retrieving revision 1.242
diff -p -U2 -r1.242 string.c
--- string.c	29 Dec 2005 17:03:27 -0000	1.242
+++ string.c	27 Jan 2006 01:31:02 -0000
@@ -3844,4 +3844,5 @@ rb_str_scan(VALUE str, VALUE pat)
 
     pat = get_pat(pat, 1);
+    str = rb_str_new4(str);
     if (!rb_block_given_p()) {
 	VALUE ary = rb_ary_new();


-- 
Nobu Nakada

In This Thread

Prev Next