~alcinnz/rhapsode

6b861831769905747381ad725f506d5567d7cf3d — Adrian Cochrane 3 years ago 5eb05d7
Fix keyboard input handling.
1 files changed, 3 insertions(+), 3 deletions(-)

M src/main.c
M src/main.c => src/main.c +3 -3
@@ 325,7 325,7 @@ int speak_finalize(char *ssml, char *v2j_profile, char **links, char **out_link)
                if (*out_link == NULL) pid_waitwake = v2j_waitwake(v2j_profile);
            }
            free(line);
        } else {
        } else if (ch > 0) {
            // Read in a line
            tcsetattr(0, TCSANOW, &stored_settings);
            char buffer[512];


@@ 334,9 334,9 @@ int speak_finalize(char *ssml, char *v2j_profile, char **links, char **out_link)
            putchar(ch);

            char *line = buffer + 1;
            size_t len = 512;
            size_t len = 510;
            if (getline(&line, &len, stdin) < 0)
                fprintf(stderr, "Failed to read stdin line!\n");
                perror("Failed to read stdin line");
            else if (out_link != NULL)
                *out_link = select_link(links, buffer);
            tcsetattr(0, TCSANOW, &no_echo);