Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.string.outdent() wrongly manages Windows newlines, and it isn't pure nothrow #9991

Open
dlangBugzillaToGithub opened this issue Jul 16, 2013 · 0 comments
Labels
Arch:x86 Issues specific to x86 OS:Windows Issues Specific to Windows Severity:Normal

Comments

@dlangBugzillaToGithub
Copy link

bearophile_hugs reported this on 2013-07-16T16:12:56Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=10654

Description

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.
@LightBender LightBender removed the P3 label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch:x86 Issues specific to x86 OS:Windows Issues Specific to Windows Severity:Normal
Projects
None yet
Development

No branches or pull requests

2 participants