|
39 | 39 | * Portions Copyright (c) 1994, Regents of the University of California
|
40 | 40 | * Portions taken from FreeBSD.
|
41 | 41 | *
|
42 |
| - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.64 2004/10/22 22:30:57 tgl Exp $ |
| 42 | + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.65 2004/10/24 15:55:29 tgl Exp $ |
43 | 43 | *
|
44 | 44 | *-------------------------------------------------------------------------
|
45 | 45 | */
|
@@ -407,14 +407,17 @@ readfile(char *path)
|
407 | 407 |
|
408 | 408 | /*
|
409 | 409 | * write an array of lines to a file
|
| 410 | + * |
| 411 | + * This is only used to write text files. Use fopen "w" not PG_BINARY_W |
| 412 | + * so that the resulting configuration files are nicely editable on Windows. |
410 | 413 | */
|
411 | 414 | staticvoid
|
412 | 415 | writefile(char*path,char**lines)
|
413 | 416 | {
|
414 | 417 | FILE*out_file;
|
415 | 418 | char**line;
|
416 | 419 |
|
417 |
| -if ((out_file=fopen(path,PG_BINARY_W))==NULL) |
| 420 | +if ((out_file=fopen(path,"w"))==NULL) |
418 | 421 | {
|
419 | 422 | fprintf(stderr,_("%s: could not open file \"%s\" for writing: %s\n"),
|
420 | 423 | progname,path,strerror(errno));
|
|