D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10654 - std.string.outdent() wrongly manages Windows newlines, and it isn't pure nothrow
Summary: std.string.outdent() wrongly manages Windows newlines, and it isn't pure nothrow
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-16 16:12 UTC by bearophile_hugs
Modified: 2024-12-01 16:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2013-07-16 16:12:56 UTC
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.
Comment 1 dlangBugzillaToGithub 2024-12-01 16:18:19 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/9991

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB