Commit 23717760 authored by Bruce Momjian's avatar Bruce Momjian

Fix for adding \n for zero-length win32 read_pipe return

parent e617fe72
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/port/exec.c,v 1.22 2004/08/16 01:26:31 momjian Exp $ * $PostgreSQL: pgsql/src/port/exec.c,v 1.23 2004/08/16 02:46:36 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -402,7 +402,7 @@ static char *pipe_read_line(char *cmd, char *line, int maxsize) ...@@ -402,7 +402,7 @@ static char *pipe_read_line(char *cmd, char *line, int maxsize)
* We emulate fgets() behaviour. So if there is no newline * We emulate fgets() behaviour. So if there is no newline
* at the end, we add one... * at the end, we add one...
*/ */
if (line[len-1] != '\n') if (len == 0 || line[len-1] != '\n')
strcat(line,"\n"); strcat(line,"\n");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment