[Issue 10654] New: std.string.outdent() wrongly manages Windows newlines, and it isn't pure nothrow

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 16 16:12:57 PDT 2013


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

           Summary: std.string.outdent() wrongly manages Windows newlines,
                    and it isn't pure nothrow
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-07-16 16:12:56 PDT ---
If I save this program on Windows (with the typical newlines used on Windows):


import std.stdio: writeln;
import std.string: outdent;
string foo() /*pure nothrow*/ {
    return q{
              first line
              second line
              third line
            }.outdent;
}
void main() {
    writeln(foo());
}


It outputs double newlines:


first line

second line

third line


Also std.string.outdent() is not pure nor nothrow.

-- 
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