|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.bugs - [Issue 2093] New: string concatenation modifies original
http://d.puremagic.com/issues/show_bug.cgi?id=2093 Summary: string concatenation modifies original Product: D Version: 2.014 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: bartosz relisoft.com I will attach source code for this example. It's an XML parser. It should produce the following output: c:\D\Work>xml root child color=red Text=foo bar baz Instead it produces this: c:\D\Work>xml root rootd rootd=red Text=rootdar baz The problem is that strings are modified after being copied, when the original is concatenated upon. The problem goes away if I idup strings: _name = name.idup; _value = value.idup; or when I replace a ~= b; with a = a ~ b; -- May 10 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2093 ------- Comment #1 from bartosz relisoft.com 2008-05-10 14:31 ------- Created an attachment (id=256) --> (http://d.puremagic.com/issues/attachment.cgi?id=256&action=view) Test case -- May 10 2008
<d-bugmail puremagic.com> wrote in message news:bug-2093-3 http.d.puremagic.com/issues/...or when I replace a ~= b; with a = a ~ b; May 10 2008
|