changeset 52642:b7153eff0558

8210987: Extra newlines on Windows when running nsk jdb tests Summary: fix skipping over newlines Reviewed-by: dholmes, jcbeyler, amenkov
author cjplummer
date Sat, 22 Sep 2018 14:12:48 -0700
parents f191aca8f96d
children 16f0deae8fa6
files test/hotspot/jtreg/vmTestbase/nsk/share/jdb/Jdb.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jdb/Jdb.java	Fri Sep 21 15:38:43 2018 -0700
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jdb/Jdb.java	Sat Sep 22 14:12:48 2018 -0700
@@ -291,7 +291,7 @@
                 jdbCommand += lineSeparator;
             } else {
                 // we don't want to log the line separator
-                logCmd = jdbCommand.substring(0, jdbCommand.length() - 1);
+                logCmd = jdbCommand.substring(0, jdbCommand.length() - lineSeparator.length());
             }
             launcher.getLog().display("Sending command: " + logCmd);
 
@@ -698,7 +698,7 @@
             int i = string.indexOf(lineSeparator, ind);
             if (i >= 0) {
                 v.add(string.substring(ind, i));
-                ind = i + 1;
+                ind = i + lineSeparator.length();
             } else {
                 v.add(string.substring(ind));
                 break;