diff options
author | Bruce Momjian <bruce@momjian.us> | 2000-04-11 17:35:50 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2000-04-11 17:35:50 +0000 |
commit | 354a39bc44cb030efb54d974eff49d6664c446dc (patch) | |
tree | f3b38c4862a58b1278a963bfd3bdb17970eaa509 | |
parent | c85a8e9df52529ffea452399709d7f2995eb4201 (diff) | |
download | postgresql-354a39bc44cb030efb54d974eff49d6664c446dc.tar.gz postgresql-354a39bc44cb030efb54d974eff49d6664c446dc.zip |
Clean up temp files from \e.
-rw-r--r-- | src/bin/psql/command.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 5c6929a7192..a66e9f4c73e 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.26 2000/03/27 21:11:37 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.27 2000/04/11 17:35:50 momjian Exp $ */ #include "postgres.h" #include "command.h" @@ -1456,14 +1456,15 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf) fclose(stream); } - /* remove temp file */ - if (!filename_arg) + } + + /* remove temp file */ + if (!filename_arg) + { + if (remove(fname)==-1) { - if (remove(fname)==-1) - { - psql_error("%s: %s\n", fname, strerror(errno)); - error=true; - } + psql_error("%s: %s\n", fname, strerror(errno)); + error=true; } } |