mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 13:05:22 +02:00
[243699] [dstore] Loop in OutputHandler
This commit is contained in:
parent
006e65e149
commit
12ee882ba1
1 changed files with 10 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* David McKnight (IBM) - [207178] changing list APIs for file service and subsystems
|
* David McKnight (IBM) - [207178] changing list APIs for file service and subsystems
|
||||||
|
* David McKnight (IBM) - [243699] [dstore] Loop in OutputHandler
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.dstore.universal.miners.command;
|
package org.eclipse.rse.internal.dstore.universal.miners.command;
|
||||||
|
@ -205,13 +206,19 @@ public class OutputHandler extends Handler {
|
||||||
|
|
||||||
// if output is not null, we assume the encoding was correct
|
// if output is not null, we assume the encoding was correct
|
||||||
// and process the output
|
// and process the output
|
||||||
if (fullOutput != null /* && fullOutput.length() == numRead */) {
|
if (fullOutput != null) {
|
||||||
// tokenize the output so that we can get each line of
|
// tokenize the output so that we can get each line of
|
||||||
// output
|
// output
|
||||||
// the delimiters are therefore set to "\n\r"
|
// the delimiters are therefore set to "\n\r"
|
||||||
StringTokenizer tokenizer = new StringTokenizer(
|
StringTokenizer tokenizer = new StringTokenizer(
|
||||||
fullOutput, "\n\r"); //$NON-NLS-1$
|
fullOutput, "\n\r"); //$NON-NLS-1$
|
||||||
int numTokens = tokenizer.countTokens();
|
int numTokens = tokenizer.countTokens();
|
||||||
|
if (numTokens == 0){
|
||||||
|
output = new String[1];
|
||||||
|
output[0] = fullOutput;
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
output = new String[numTokens];
|
output = new String[numTokens];
|
||||||
int index = 0;
|
int index = 0;
|
||||||
while (tokenizer.hasMoreTokens()) {
|
while (tokenizer.hasMoreTokens()) {
|
||||||
|
@ -220,6 +227,8 @@ public class OutputHandler extends Handler {
|
||||||
}
|
}
|
||||||
|
|
||||||
String lastLine = output[index - 1];
|
String lastLine = output[index - 1];
|
||||||
|
|
||||||
|
|
||||||
if (!_endOfStream && (!fullOutput.endsWith("\n") && !fullOutput.endsWith("\r"))) //$NON-NLS-1$ //$NON-NLS-2$
|
if (!_endOfStream && (!fullOutput.endsWith("\n") && !fullOutput.endsWith("\r"))) //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
{
|
{
|
||||||
// our last line may be cut off
|
// our last line may be cut off
|
||||||
|
|
Loading…
Add table
Reference in a new issue