lib/standard/string: bugfix in Array::to_s when encoutering another structure than...
authorLucas Bajolet <r4pass@hotmail.com>
Fri, 29 Aug 2014 14:35:43 +0000 (10:35 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Tue, 2 Sep 2014 20:16:29 +0000 (16:16 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/standard/string.nit

index 22c32e8..b57a3a5 100644 (file)
@@ -1874,8 +1874,9 @@ redef class Array[E]
                        else
                                for j in tmp.substrings do
                                        var s = j.as(FlatString)
-                                       s.items.copy_to(ns, tpl, s.index_from, off)
-                                       off += tpl
+                                       var slen = s.length
+                                       s.items.copy_to(ns, slen, s.index_from, off)
+                                       off += slen
                                end
                        end
                        i += 1