summaryrefslogtreecommitdiff
path: root/src/port/exec.c
diff options
context:
space:
mode:
authorBruce Momjian2004-08-16 02:46:36 +0000
committerBruce Momjian2004-08-16 02:46:36 +0000
commit23717760d1eb9441f672a2d01b52bddfceb8c2e2 (patch)
tree157609d5f93b7dd88ab6d23e03c77c14179359a0 /src/port/exec.c
parente617fe729d5ca625a58919c09d8117713ae6d51d (diff)
Fix for adding \n for zero-length win32 read_pipe return
Diffstat (limited to 'src/port/exec.c')
-rw-r--r--src/port/exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/port/exec.c b/src/port/exec.c
index 5a0badff204..192e3228461 100644
--- a/src/port/exec.c
+++ b/src/port/exec.c
@@ -7,7 +7,7 @@
*
*
* 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)
* We emulate fgets() behaviour. So if there is no newline
* at the end, we add one...
*/
- if (line[len-1] != '\n')
+ if (len == 0 || line[len-1] != '\n')
strcat(line,"\n");
}