www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 589] New: std.string.newline should be char[] not char[2]

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=589

           Summary: std.string.newline should be char[] not char[2]
           Product: D
           Version: 0.174
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: wbaxter gmail.com


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.


-- 
Nov 23 2006
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=589


deewiant gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from deewiant gmail.com  2006-12-03 04:04 -------
Fixed in DMD 0.176 by making it char[1] when it's just \n.


-- 
Dec 03 2006