This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git


The following commit(s) were added to refs/heads/master by this push:
     new e32a4f4  [FELIX-6509] Evaluation of subshell String results are wrong 
on Windows
e32a4f4 is described below

commit e32a4f45944736c8a42ccc4422f85aeeeb4743d7
Author: Guillaume Nodet <[email protected]>
AuthorDate: Mon Mar 7 15:35:22 2022 +0100

    [FELIX-6509] Evaluation of subshell String results are wrong on Windows
---
 gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java 
b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java
index 8667b94..71d4844 100644
--- a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java
+++ b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java
@@ -385,7 +385,7 @@ public class Closure implements Function, Evaluate
                 return result;
             } else {
                 String s = baos.toString();
-                while (!s.isEmpty() && s.charAt(s.length() - 1) == '\n') {
+                while (!s.isEmpty() && (s.charAt(s.length() - 1) == '\n' || 
s.charAt(s.length() - 1) == '\r')) {
                     s = s.substring(0, s.length() - 1);
                 }
                 return s;

Reply via email to