diff options
| author | Tom Lane | 2020-09-22 19:55:13 +0000 |
|---|---|---|
| committer | Tom Lane | 2020-09-22 19:55:13 +0000 |
| commit | 931487018c409a3102452f965ccaa48367244a41 (patch) | |
| tree | e959b76c7754b2b7af7bfa593e1825fa0328f88d /src/interfaces | |
| parent | c4133ec169dfe47803656325dbfb8397f85a70ea (diff) | |
Rethink API for pg_get_line.c, one more time.
Further experience says that the appending behavior offered by
pg_get_line_append is useful to only a very small minority of callers.
For most, the requirement to reset the buffer after each line is just
an error-prone nuisance. Hence, invent another alternative call
pg_get_line_buf, which takes care of that detail.
Noted while reviewing a patch from Daniel Gustafsson.
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/interfaces')
| -rw-r--r-- | src/interfaces/ecpg/test/pg_regress_ecpg.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/test/pg_regress_ecpg.c b/src/interfaces/ecpg/test/pg_regress_ecpg.c index a2d7b70d9a3..6e1d25b1f4a 100644 --- a/src/interfaces/ecpg/test/pg_regress_ecpg.c +++ b/src/interfaces/ecpg/test/pg_regress_ecpg.c @@ -49,7 +49,7 @@ ecpg_filter(const char *sourcefile, const char *outfile) initStringInfo(&linebuf); - while (pg_get_line_append(s, &linebuf)) + while (pg_get_line_buf(s, &linebuf)) { /* check for "#line " in the beginning */ if (strstr(linebuf.data, "#line ") == linebuf.data) @@ -69,7 +69,6 @@ ecpg_filter(const char *sourcefile, const char *outfile) } } fputs(linebuf.data, t); - resetStringInfo(&linebuf); } pfree(linebuf.data); |
