1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-05-23 13:12:41 +00:00

READLINE now prints newline on empty input line

This commit is contained in:
Gerhard Rieger 2025-01-24 16:54:50 +01:00
parent 920ed1f0a3
commit 68f0143f7b
2 changed files with 7 additions and 0 deletions

View file

@ -37,6 +37,10 @@ Corrections:
when malloc() does not initialize memory with zeros.
Thanks to Nicolas Cavallari for reporting and fixing this bug.
The readline() library function does not output the newline of empty
input lines. Changed Socat to explicitly print the newline in this
case.
Building:
Disabling certain features during configure could break build process.

View file

@ -204,6 +204,9 @@ ssize_t xioread_readline(struct single *pipe, void *buff, size_t bufsiz) {
if (line == NULL) {
return 0; /* EOF */
}
if (strlen(line) == 0) {
Write(STDOUT_FILENO, "\n", 1);
}
#if _WITH_TERMIOS
xiotermios_clrflag(pipe->fd, 3, ECHO);
xiotermios_flush(pipe->fd);