1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

[252060] applied patch from Greg Watson.

This commit is contained in:
Anna Dushistova 2008-12-19 13:50:32 +00:00
parent 028fc5c617
commit 67258abee6

View file

@ -1,16 +1,17 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006 PalmSource, Inc. * Copyright (c) 2006 PalmSource, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Ewa Matejska (PalmSource) - initial version * Ewa Matejska (PalmSource) - initial version
* Martin Oberhuber (Wind River) - adapt to IHostOutput API (bug 161773, 158312) * Martin Oberhuber (Wind River) - adapt to IHostOutput API (bug 161773, 158312)
* Martin Oberhuber (Wind River) - moved from org.eclipse.rse.remotecdt (bug 161777) * Martin Oberhuber (Wind River) - moved from org.eclipse.rse.remotecdt (bug 161777)
* Martin Oberhuber (Wind River) - renamed from HostShellAdapter (bug 161777) * Martin Oberhuber (Wind River) - renamed from HostShellAdapter (bug 161777)
* Martin Oberhuber (Wind River) - improved Javadoc * Martin Oberhuber (Wind River) - improved Javadoc
* Greg Watson (IBM) - patch for bug #252060
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.services.shells; package org.eclipse.rse.services.shells;
@ -154,13 +155,20 @@ IHostShellOutputListener {
*/ */
public void shellOutputChanged(IHostShellChangeEvent event) { public void shellOutputChanged(IHostShellChangeEvent event) {
IHostOutput[] input = event.getLines(); IHostOutput[] input = event.getLines();
if (input.length == 0) {
try {
outputStream.close();
} catch (IOException e) {
}
return;
}
OutputStream outputStream = event.isError() ? hostShellError : hostShellInput; OutputStream outputStream = event.isError() ? hostShellError : hostShellInput;
try { try {
for(int i = 0; i < input.length; i++) { for(int i = 0; i < input.length; i++) {
outputStream.write(input[i].getString().getBytes()); outputStream.write(input[i].getString().getBytes());
outputStream.write('\n'); outputStream.write('\n');
outputStream.flush(); outputStream.flush();
} }
} catch(IOException e) { } catch(IOException e) {
// Ignore // Ignore
} }