psql: Make temporary editor files have .sql extension

This gives editors a better chance to treat these files as the SQL
files that they are.
This commit is contained in:
Peter Eisentraut 2011-12-02 23:38:33 +02:00
parent 0de93a9c69
commit b6f9834a9e
1 changed files with 2 additions and 2 deletions

View File

@ -1879,10 +1879,10 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf,
*/
#endif
#ifndef WIN32
snprintf(fnametmp, sizeof(fnametmp), "%s%spsql.edit.%d", tmpdir,
snprintf(fnametmp, sizeof(fnametmp), "%s%spsql.edit.%d.sql", tmpdir,
"/", (int) getpid());
#else
snprintf(fnametmp, sizeof(fnametmp), "%s%spsql.edit.%d", tmpdir,
snprintf(fnametmp, sizeof(fnametmp), "%s%spsql.edit.%d.sql", tmpdir,
"" /* trailing separator already present */ , (int) getpid());
#endif