1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Open files in binary mode on Win32 so control-z isn't seen as EOF.

This commit is contained in:
Bruce Momjian
2004-07-11 00:54:55 +00:00
parent e5ca4bde79
commit 330c6c42be
4 changed files with 20 additions and 8 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.117 2004/06/18 06:14:04 tgl Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.118 2004/07/11 00:54:55 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@ -1197,7 +1197,7 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf)
if (!error)
{
#endif
stream = fopen(fname, "r");
stream = fopen(fname, R_TEXTFILE);
if (!stream)
{
psql_error("%s: %s\n", fname, strerror(errno));
@ -1262,7 +1262,7 @@ process_file(char *filename)
if (!filename)
return false;
fd = fopen(filename, "r");
fd = fopen(filename, R_TEXTFILE);
if (!fd)
{