Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfd62065

Browse files
committed
Fix Win32 pg_dumpall, with help from Claudio.
1 parent2732932 commitfd62065

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

‎src/port/exec.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/port/exec.c,v 1.18 2004/08/0802:22:55 momjian Exp $
10+
* $PostgreSQL: pgsql/src/port/exec.c,v 1.19 2004/08/0803:21:39 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -374,15 +374,28 @@ static char *pipe_read_line(char *cmd, char *line, int maxsize)
374374
CloseHandle(childstdoutrddup);
375375
returnNULL;
376376
}
377-
378-
377+
379378
/* We try just once */
380379
if (ReadFile(childstdoutrddup,line,maxsize,&bytesread,NULL)&&
381380
bytesread>0)
382381
{
383382
/* So we read some data */
384383
retval=line;
385384

385+
/*
386+
*Sometime the child returns "\r\n", which doesn't match
387+
*our version string. The backend uses
388+
*setvbuf(stdout, NULL, _IONBF, 0), but pg_dump doesn't
389+
*so we have to fix it here.
390+
*/
391+
if (strlen(line) >=2&&
392+
line[strlen(line)-2]=='\r'&&
393+
line[strlen(line)-1]=='\n')
394+
{
395+
line[strlen(line)-2]=='\n';
396+
line[strlen(line)-1]=='\0';
397+
}
398+
386399
/*
387400
*We emulate fgets() behaviour. So if there is no newline
388401
*at the end, we add one...

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp