diff options
author | David McKnight | 2010-04-22 14:18:43 +0000 |
---|---|---|
committer | David McKnight | 2010-04-22 14:18:43 +0000 |
commit | 72bdb00bea3e7de63129ad1e59a49a57e09fe054 (patch) | |
tree | 39f79058d75a9f7de47cb38b4f943498c974a98c | |
parent | 87fdec14fc2103e1a1b582abb840eeb34291e806 (diff) | |
download | org.eclipse.tm-72bdb00bea3e7de63129ad1e59a49a57e09fe054.tar.gz org.eclipse.tm-72bdb00bea3e7de63129ad1e59a49a57e09fe054.tar.xz org.eclipse.tm-72bdb00bea3e7de63129ad1e59a49a57e09fe054.zip |
[309338] [dstore] z/OS USS - invocation of 'env' shell command returns inconsistently organized output
-rw-r--r-- | rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/command/OutputHandler.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/command/OutputHandler.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/command/OutputHandler.java index 231dbc3ce..938703ab9 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/command/OutputHandler.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/command/OutputHandler.java @@ -220,6 +220,9 @@ public class OutputHandler extends Handler { // note that the first encoding will be the encoding that we were // given int encodingIndex = 0; + + + while (encodingIndex < _encodings.size()) { String encoding = (String) (_encodings.get(encodingIndex)); @@ -302,7 +305,18 @@ public class OutputHandler extends Handler { else { lastBytes[lastIndex] = (byte)c; - if (lastBytes[lastIndex] == '\r' || lastBytes[lastIndex] == '\n'){ + + String osname = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$ + char lf = '\r'; + char nl = '\n'; + + // in ebcdic, the following chars are used + if (osname.startsWith("z")){ //$NON-NLS-1$ + lf = '\25'; + nl = '\15'; + } + + if (lastBytes[lastIndex] == lf || lastBytes[lastIndex] == nl){ // we've hit the end of line; String suffix = new String(lastBytes, 0, lastIndex + 1, encoding); output[index - 1] = lastLine + suffix.substring(0, suffix.length() - 1); |