diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index 8748225976a..24a44b81a95 100644 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -902,12 +902,12 @@ read_one_statement(StringInfo inBuf, FILE *pfile) break; } - destroyStringInfo(&q); - if (c == '\n') appendStringInfoChar(inBuf, (char) '\n'); } + destroyStringInfo(&q); + /* No input before EOF signal means time to quit. */ if (c == EOF && inBuf->len == 0) return EOF;