Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I'm trying this use case (gogo-runtime 1.1.4):
karaf@root()> "MyTest" toCharArray [M, y, T, e, s, t]
and it's fine. However, trying this:
karaf@root()> config:property-set -p test test "MyTest" karaf@root()> config:property-get -p test test MyTest karaf@root()> ((config:property-get -p test test)) toCharArray ]M, y, T, e, s, t,
produces weird result. Actually understandable - the \r is not trimmed from the result, so it moves cursor to the beginning of the line, and ] overwrites initial [.
the reason is this loop:
String s = baos.toString(); while (!s.isEmpty() && s.charAt(s.length() - 1) == '\n') { s = s.substring(0, s.length() - 1); }
it isn't OS aware. \r should also be removed (probably affects Mac too).