diff options
Diffstat (limited to 'src/bin/psql/prompt.c')
-rw-r--r-- | src/bin/psql/prompt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c index 509e6422b7e..3955d72206c 100644 --- a/src/bin/psql/prompt.c +++ b/src/bin/psql/prompt.c @@ -266,8 +266,10 @@ get_prompt(promptStatus_t status, ConditionalStack cstack) { int cmdend = strcspn(p + 1, "`"); char *file = pnstrdup(p + 1, cmdend); - FILE *fd = popen(file, "r"); + FILE *fd; + fflush(NULL); + fd = popen(file, "r"); if (fd) { if (fgets(buf, sizeof(buf), fd) == NULL) |