1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Do not pass an empty string.

This commit is contained in:
Alain Magloire 2004-02-02 14:18:09 +00:00
parent 0dc064bbd6
commit e2482f2bc6

View file

@ -41,28 +41,37 @@ public class TxThread extends Thread {
}
if (cmd != null) {
// Move to the RxQueue only if RxThread is alive.
Thread rx = session.getRxThread();
if (rx != null && rx.isAlive()) {
CommandQueue rxQueue = session.getRxQueue();
rxQueue.addCommand(cmd);
String str = cmd.toString();
// if string is empty consider as a noop
if (str.length() > 0) {
// Move to the RxQueue only if RxThread is alive.
Thread rx = session.getRxThread();
if (rx != null && rx.isAlive()) {
CommandQueue rxQueue = session.getRxQueue();
rxQueue.addCommand(cmd);
} else {
// The RxThread is not running
synchronized (cmd) {
cmd.notifyAll();
}
}
// Process the Command line to recognise patterns we may need to fire event.
if (cmd instanceof CLICommand) {
cli.process((CLICommand)cmd);
}
// shove in the pipe
if (out != null) {
out.write(str.getBytes());
out.flush();
}
} else {
// String is empty consider as a noop
synchronized (cmd) {
cmd.notifyAll();
}
}
// May need to fire event.
if (cmd instanceof CLICommand) {
cli.process((CLICommand)cmd);
}
// shove in the pipe
String str = cmd.toString();
if (out != null && str.length() > 0) {
out.write(str.getBytes());
out.flush();
}
}
}
} catch (IOException e) {