Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
330c6c42
Commit
330c6c42
authored
20 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Open files in binary mode on Win32 so control-z isn't seen as EOF.
parent
e5ca4bde
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/bin/psql/command.c
+3
-3
3 additions, 3 deletions
src/bin/psql/command.c
src/bin/psql/common.h
+13
-1
13 additions, 1 deletion
src/bin/psql/common.h
src/bin/psql/copy.c
+2
-2
2 additions, 2 deletions
src/bin/psql/copy.c
src/bin/psql/psqlscan.l
+2
-2
2 additions, 2 deletions
src/bin/psql/psqlscan.l
with
20 additions
and
8 deletions
src/bin/psql/command.c
+
3
−
3
View file @
330c6c42
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.11
7
2004/0
6
/1
8
0
6:14:04 tgl
Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.11
8
2004/0
7
/1
1
0
0:54:55 momjian
Exp $
*/
*/
#include
"postgres_fe.h"
#include
"postgres_fe.h"
#include
"command.h"
#include
"command.h"
...
@@ -1197,7 +1197,7 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf)
...
@@ -1197,7 +1197,7 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf)
if
(
!
error
)
if
(
!
error
)
{
{
#endif
#endif
stream
=
fopen
(
fname
,
"r"
);
stream
=
fopen
(
fname
,
R_TEXTFILE
);
if
(
!
stream
)
if
(
!
stream
)
{
{
psql_error
(
"%s: %s
\n
"
,
fname
,
strerror
(
errno
));
psql_error
(
"%s: %s
\n
"
,
fname
,
strerror
(
errno
));
...
@@ -1262,7 +1262,7 @@ process_file(char *filename)
...
@@ -1262,7 +1262,7 @@ process_file(char *filename)
if
(
!
filename
)
if
(
!
filename
)
return
false
;
return
false
;
fd
=
fopen
(
filename
,
"r"
);
fd
=
fopen
(
filename
,
R_TEXTFILE
);
if
(
!
fd
)
if
(
!
fd
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/bin/psql/common.h
+
13
−
1
View file @
330c6c42
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/bin/psql/common.h,v 1.3
5
2004/0
4
/1
9 17:42
:5
8
momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/common.h,v 1.3
6
2004/0
7
/1
1 00:54
:5
5
momjian Exp $
*/
*/
#ifndef COMMON_H
#ifndef COMMON_H
#define COMMON_H
#define COMMON_H
...
@@ -62,4 +62,16 @@ extern char parse_char(char **buf);
...
@@ -62,4 +62,16 @@ extern char parse_char(char **buf);
extern
char
*
expand_tilde
(
char
**
filename
);
extern
char
*
expand_tilde
(
char
**
filename
);
/*
* WIN32 treats Control-Z as EOF in files opened in text mode.
* Therefore, we open files in binary mode on Win32 so we can read
* literal control-Z. The other affect is that we see CRLF, but
* that is OK because we can already handle those cleanly.
*/
#ifndef WIN32
#define R_TEXTFILE "r"
#else
#define R_TEXTFILE "rb"
#endif
#endif
/* COMMON_H */
#endif
/* COMMON_H */
This diff is collapsed.
Click to expand it.
src/bin/psql/copy.c
+
2
−
2
View file @
330c6c42
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.4
7
2004/0
5/07
00:
2
4:5
8 tgl
Exp $
* $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.4
8
2004/0
7/11
00:
5
4:5
5 momjian
Exp $
*/
*/
#include
"postgres_fe.h"
#include
"postgres_fe.h"
#include
"copy.h"
#include
"copy.h"
...
@@ -516,7 +516,7 @@ do_copy(const char *args)
...
@@ -516,7 +516,7 @@ do_copy(const char *args)
if
(
options
->
from
)
if
(
options
->
from
)
{
{
if
(
options
->
file
)
if
(
options
->
file
)
copystream
=
fopen
(
options
->
file
,
"r"
);
copystream
=
fopen
(
options
->
file
,
R_TEXTFILE
);
else
if
(
!
options
->
psql_inout
)
else
if
(
!
options
->
psql_inout
)
copystream
=
pset
.
cur_cmd_source
;
copystream
=
pset
.
cur_cmd_source
;
else
else
...
...
This diff is collapsed.
Click to expand it.
src/bin/psql/psqlscan.l
+
2
−
2
View file @
330c6c42
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/psql/psqlscan.l,v 1.
3
2004/0
5/07
00:
2
4:5
8 tgl
Exp $
* $PostgreSQL: pgsql/src/bin/psql/psqlscan.l,v 1.
4
2004/0
7/11
00:
5
4:5
5 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1284,7 +1284,7 @@ psql_scan_slash_option(PsqlScanState state,
...
@@ -1284,7 +1284,7 @@ psql_scan_slash_option(PsqlScanState state,
char buf[512];
char buf[512];
size_t result;
size_t result;
fd = popen(cmd,
"r"
);
fd = popen(cmd,
R_TEXTFILE
);
if (!fd)
if (!fd)
{
{
psql_error("%s: %s\n", cmd, strerror(errno));
psql_error("%s: %s\n", cmd, strerror(errno));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment