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:
parent
028fc5c617
commit
67258abee6
1 changed files with 15 additions and 7 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue