Skip to content

Commit 0157945

Browse files
committed
Fix inconsistent message wording, and split off a couple of duplicated strings.
1 parent 93190c3 commit 0157945

File tree

1 file changed

+28
-19
lines changed

1 file changed

+28
-19
lines changed

src/bin/initdb/initdb.c

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.150 2007/11/15 21:14:41 momjian Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.151 2007/11/16 21:47:32 alvherre Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -938,26 +938,31 @@ check_input(char *path)
938938
if (stat(path, &statbuf) != 0)
939939
{
940940
if (errno == ENOENT)
941+
{
942+
fprintf(stderr,
943+
_("%s: file \"%s\" does not exist\n"), progname, path);
941944
fprintf(stderr,
942-
_("%s: file \"%s\" does not exist\n"
943-
"This means you have a corrupted installation or identified\n"
944-
"the wrong directory with the invocation option -L.\n"),
945-
progname, path);
945+
_("This might mean you have a corrupted installation or identified\n"
946+
"the wrong directory with the invocation option -L.\n"));
947+
}
946948
else
949+
{
947950
fprintf(stderr,
948-
_("%s: could not access file \"%s\": %s\n"
949-
"This might mean you have a corrupted installation or identified\n"
950-
"the wrong directory with the invocation option -L.\n"),
951-
progname, path, strerror(errno));
951+
_("%s: could not access file \"%s\": %s\n"), progname, path,
952+
strerror(errno));
953+
fprintf(stderr,
954+
_("This might mean you have a corrupted installation or identified\n"
955+
"the wrong directory with the invocation option -L.\n"));
956+
}
952957
exit(1);
953958
}
954959
if (!S_ISREG(statbuf.st_mode))
955960
{
956961
fprintf(stderr,
957-
_("%s: file \"%s\" is not a regular file\n"
958-
"This means you have a corrupted installation or identified\n"
959-
"the wrong directory with the invocation option -L.\n"),
960-
progname, path);
962+
_("%s: file \"%s\" is not a regular file\n"), progname, path);
963+
fprintf(stderr,
964+
_("This might mean you have a corrupted installation or identified\n"
965+
"the wrong directory with the invocation option -L.\n"));
961966
exit(1);
962967
}
963968
}
@@ -2958,11 +2963,13 @@ main(int argc, char *argv[])
29582963
case 2:
29592964
/* Present and not empty */
29602965
fprintf(stderr,
2961-
_("%s: directory \"%s\" exists but is not empty\n"
2962-
"If you want to create a new database system, either remove or empty\n"
2966+
_("%s: directory \"%s\" exists but is not empty\n"),
2967+
progname, pg_data);
2968+
fprintf(stderr,
2969+
_("If you want to create a new database system, either remove or empty\n"
29632970
"the directory \"%s\" or run %s\n"
29642971
"with an argument other than \"%s\".\n"),
2965-
progname, pg_data, pg_data, progname, pg_data);
2972+
pg_data, progname, pg_data);
29662973
exit(1); /* no further message needed */
29672974

29682975
default:
@@ -3022,10 +3029,12 @@ main(int argc, char *argv[])
30223029
case 2:
30233030
/* Present and not empty */
30243031
fprintf(stderr,
3025-
_("%s: directory \"%s\" exists but is not empty\n"
3026-
"If you want to store the transaction log there, either\n"
3032+
_("%s: directory \"%s\" exists but is not empty\n"),
3033+
progname, xlog_dir);
3034+
fprintf(stderr,
3035+
_("If you want to store the transaction log there, either\n"
30273036
"remove or empty the directory \"%s\".\n"),
3028-
progname, xlog_dir, xlog_dir);
3037+
xlog_dir);
30293038
exit(1); /* no further message needed */
30303039

30313040
default:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy