diff --git a/CHANGES b/CHANGES index 02e50c2..2950b31 100644 --- a/CHANGES +++ b/CHANGES @@ -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. diff --git a/xio-readline.c b/xio-readline.c index 2807379..69423c0 100644 --- a/xio-readline.c +++ b/xio-readline.c @@ -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);