Skip to content

Commit 2371776

Browse files
committed
Fix for adding \n for zero-length win32 read_pipe return
1 parent e617fe7 commit 2371776

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/port/exec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/port/exec.c,v 1.22 2004/08/16 01:26:31 momjian Exp $
10+
* $PostgreSQL: pgsql/src/port/exec.c,v 1.23 2004/08/16 02:46:36 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -402,7 +402,7 @@ static char *pipe_read_line(char *cmd, char *line, int maxsize)
402402
* We emulate fgets() behaviour. So if there is no newline
403403
* at the end, we add one...
404404
*/
405-
if (line[len-1] != '\n')
405+
if (len == 0 || line[len-1] != '\n')
406406
strcat(line,"\n");
407407
}
408408

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy