aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/prompt.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-04-19 16:02:17 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-04-19 16:02:17 +0000
commit3224f2ee250cf5b53dc201d850b03d1e319f1782 (patch)
tree1f3fb6e12244ef700216e688ddb1d85246992d53 /src/bin/psql/prompt.c
parente37a649e94298271745d0e4729deea35899c3b0c (diff)
downloadpostgresql-3224f2ee250cf5b53dc201d850b03d1e319f1782.tar.gz
postgresql-3224f2ee250cf5b53dc201d850b03d1e319f1782.zip
Fix a couple of rather-pointless-but-easily-fixed Coverity warnings.
Per Martijn van Oosterhout.
Diffstat (limited to 'src/bin/psql/prompt.c')
-rw-r--r--src/bin/psql/prompt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c
index a11d849392d..f7d591b0545 100644
--- a/src/bin/psql/prompt.c
+++ b/src/bin/psql/prompt.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.43 2006/03/05 15:58:52 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.44 2006/04/19 16:02:17 tgl Exp $
*/
#include "postgres_fe.h"
#include "prompt.h"
@@ -250,14 +250,13 @@ get_prompt(promptStatus_t status)
/* execute command */
case '`':
{
- FILE *fd = NULL;
+ FILE *fd;
char *file = pg_strdup(p + 1);
int cmdend;
cmdend = strcspn(file, "`");
file[cmdend] = '\0';
- if (file)
- fd = popen(file, "r");
+ fd = popen(file, "r");
if (fd)
{
fgets(buf, MAX_PROMPT_SIZE - 1, fd);