Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid McKnight2010-04-22 14:18:43 +0000
committerDavid McKnight2010-04-22 14:18:43 +0000
commit72bdb00bea3e7de63129ad1e59a49a57e09fe054 (patch)
tree39f79058d75a9f7de47cb38b4f943498c974a98c
parent87fdec14fc2103e1a1b582abb840eeb34291e806 (diff)
downloadorg.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.java16
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);

Back to the top