Bug 589 – std.string.newline should be char[] not char[2]

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-11-23T18:05:00Z
Last change time
2014-02-15T13:28:58Z
Assigned to
bugzilla
Creator
wbaxter

Comments

Comment #0 by wbaxter — 2006-11-23T18:05:22Z
std.string.newline is char[2], which means if you do "astring"~newline on a platform where newline is "\n" you'll get a lovely bonus Null character in your output. It should either be made char[1] when it is one char, char[2] when it's not, or just char[] for all cases.
Comment #1 by matti.niemenmaa+dbugzilla — 2006-12-03T04:04:08Z
Fixed in DMD 0.176 by making it char[1] when it's just \n.