[Issue 10773] New: std.algorithm.splitter produces infinite range with empty delimiter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 7 13:15:58 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10773

           Summary: std.algorithm.splitter produces infinite range with
                    empty delimiter
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: hsteoh at quickfur.ath.cx


--- Comment #0 from hsteoh at quickfur.ath.cx 2013-08-07 13:15:56 PDT ---
Calling std.algorithm.splitter with a non-empty string and an empty delimiter
causes it to produce an infinite range of empty strings. This, in turn, causes
std.array.split to get into an infinite loop when it is called with an empty
delimiter.

When the delimiter is empty, std.algorithm.splitter should return a range
containing 1-element ranges of each element in the original range. (Cf. Perl's
split(//, "string").) At the very least, std.array.split should not have an
infinite loop.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list