lib/cpp: fix behavior of `Text::to_cpp_string`
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 26 Nov 2014 21:34:26 +0000 (16:34 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 27 Nov 2014 15:12:33 +0000 (10:12 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/cpp.nit

index bd113dd..6fe897a 100644 (file)
@@ -25,12 +25,12 @@ end
 
 redef class Text
        # Get `self` as a `CppString`
-       fun to_cpp_string: CppString do return to_cstring.to_cpp_string
+       fun to_cpp_string: CppString do return to_cstring.to_cpp_string(length)
 end
 
 redef class NativeString
        # Get `self` as a `CppString`
-       fun to_cpp_string: CppString in "C++" `{
-               return new std::string(recv);
+       fun to_cpp_string(length: Int): CppString in "C++" `{
+               return new std::string(recv, length);
        `}
 end