mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-21 15:24:17 +02:00
fix flush processing
This removes flush processing from process_command() and fixes the code in the main loop so that it does not ignore the 0 position in the buffer.
This commit is contained in:
parent
5bc67dc49d
commit
96a3b19850
1 changed files with 3 additions and 9 deletions
12
softsynth.c
12
softsynth.c
|
|
@ -77,12 +77,6 @@ static int process_command(struct synth_t *s, char *buf, int start)
|
|||
}
|
||||
cp++;
|
||||
break;
|
||||
case 24:
|
||||
cmd = CMD_FLUSH;
|
||||
stop_speech();
|
||||
queue_clear();
|
||||
cp++;
|
||||
break;
|
||||
default:
|
||||
cmd = CMD_UNKNOWN;
|
||||
cp++;
|
||||
|
|
@ -168,16 +162,16 @@ void main_loop (struct synth_t *s)
|
|||
perror("Read from softsynth failed");
|
||||
break;
|
||||
}
|
||||
for(i = length; i > 0; i--)
|
||||
*(buf+length) = 0;
|
||||
for(i = length; i >= 0; i--)
|
||||
if (*(buf+i) == 0x18) { /* synth flush char. */
|
||||
queue_clear();
|
||||
stop_speech();
|
||||
j = length-i;
|
||||
for(length = 0; length < j; length++)
|
||||
for(length = 0; length <= j; length++)
|
||||
*(buf+length) = *(buf+i++);
|
||||
break;
|
||||
}
|
||||
*(buf+length) = 0;
|
||||
process_buffer (s, buf, length);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue