summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2004-10-24 15:55:29 +0000
committerTom Lane2004-10-24 15:55:29 +0000
commite6b4707f2761e5c00d0c08bd601f6427a183f147 (patch)
treed68adee95752379f96877831dc32f538733a8c4b
parent79f6cbd57c0920b72d5f3e01d974609510f4e222 (diff)
Write config files as text not binary, per Magnus Hagander.
-rw-r--r--src/bin/initdb/initdb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 55f38aa9e0..571e1e717e 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -407,6 +407,9 @@ readfile(char *path)
/*
* write an array of lines to a file
+ *
+ * This is only used to write text files. Use fopen "w" not PG_BINARY_W
+ * so that the resulting configuration files are nicely editable on Windows.
*/
static void
writefile(char *path, char **lines)
@@ -414,7 +417,7 @@ writefile(char *path, char **lines)
FILE *out_file;
char **line;
- if ((out_file = fopen(path, PG_BINARY_W)) == NULL)
+ if ((out_file = fopen(path, "w")) == NULL)
{
fprintf(stderr, _("%s: could not open file \"%s\" for writing: %s\n"),
progname, path, strerror(errno));