Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c7ae53a6
Commit
c7ae53a6
authored
Aug 16, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify need for \r\n -> \n translation in version checking code.
parent
1a3de15a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
src/port/exec.c
src/port/exec.c
+13
-11
No files found.
src/port/exec.c
View file @
c7ae53a6
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/exec.c,v 1.2
1 2004/08/09 20:20:46 tgl
Exp $
* $PostgreSQL: pgsql/src/port/exec.c,v 1.2
2 2004/08/16 01:26:31 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -381,26 +381,28 @@ static char *pipe_read_line(char *cmd, char *line, int maxsize)
{
/* So we read some data */
retval
=
line
;
int
len
=
strlen
(
line
);
/*
* Sometime the child returns "\r\n", which doesn't match
* our version string. The backend uses
* setvbuf(stdout, NULL, _IONBF, 0), but pg_dump doesn't
* so we have to fix it here.
* If EOL is \r\n, convert to just \n.
* Because stdout is a text-mode stream, the \n output by
* the child process is received as \r\n, so we convert it
* to \n. The server main.c sets
* setvbuf(stdout, NULL, _IONBF, 0) which has the effect
* of disabling \n to \r\n expansion for stdout.
*/
if
(
strlen
(
line
)
>=
2
&&
line
[
strlen
(
line
)
-
2
]
==
'\r'
&&
line
[
strlen
(
line
)
-
1
]
==
'\n'
)
if
(
len
>=
2
&&
line
[
len
-
2
]
==
'\r'
&&
line
[
len
-
1
]
==
'\n'
)
{
line
[
strlen
(
line
)
-
2
]
=
'\n'
;
line
[
strlen
(
line
)
-
1
]
=
'\0'
;
line
[
len
-
2
]
=
'\n'
;
line
[
len
-
1
]
=
'\0'
;
len
--
;
}
/*
* We emulate fgets() behaviour. So if there is no newline
* at the end, we add one...
*/
if
(
line
[
strlen
(
line
)
-
1
]
!=
'\n'
)
if
(
line
[
len
-
1
]
!=
'\n'
)
strcat
(
line
,
"
\n
"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment