Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6c33054

Browse files
committed
Remove init_nls() functions, call set_pglocale() directly.
Add locale to pg_ctl.c.
1 parent 66fa6eb commit 6c33054

File tree

11 files changed

+27
-41
lines changed

11 files changed

+27
-41
lines changed

src/bin/initdb/initdb.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Portions Copyright (c) 1994, Regents of the University of California
4040
* Portions taken from FreeBSD.
4141
*
42-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.33 2004/05/25 01:00:22 momjian Exp $
42+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.34 2004/06/01 02:53:59 momjian Exp $
4343
*
4444
*-------------------------------------------------------------------------
4545
*/
@@ -167,7 +167,6 @@ static void check_ok(void);
167167
static bool chklocale(const char *locale);
168168
static void setlocales(void);
169169
static void usage(const char *progname);
170-
static void init_nls(const char *argv0);
171170

172171

173172
/*
@@ -1750,16 +1749,6 @@ usage(const char *progname)
17501749
printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
17511750
}
17521751

1753-
/*
1754-
* Initialized NLS if enabled.
1755-
*/
1756-
static void
1757-
init_nls(const char *argv0)
1758-
{
1759-
set_pglocale(argv0, "initdb");
1760-
}
1761-
1762-
17631752
int
17641753
main(int argc, char *argv[])
17651754
{
@@ -1797,9 +1786,9 @@ main(int argc, char *argv[])
17971786
* environment */
17981787
char *subdirs[] =
17991788
{"global", "pg_xlog", "pg_clog", "base", "base/1"};
1800-
init_nls(argv[0]);
18011789

18021790
progname = get_progname(argv[0]);
1791+
set_pglocale(argv[0], "initdb");
18031792

18041793
if (argc > 1)
18051794
{

src/bin/scripts/clusterdb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 2002-2003, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/scripts/clusterdb.c,v 1.7 2004/05/25 01:00:27 momjian Exp $
7+
* $PostgreSQL: pgsql/src/bin/scripts/clusterdb.c,v 1.8 2004/06/01 02:54:09 momjian Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -58,7 +58,8 @@ main(int argc, char *argv[])
5858
char *table = NULL;
5959

6060
progname = get_progname(argv[0]);
61-
init_nls(argv[0]);
61+
set_pglocale(argv[0], "pgscripts");
62+
6263
handle_help_version_opts(argc, argv, "clusterdb", help);
6364

6465
while ((c = getopt_long(argc, argv, "h:p:U:Weqd:at:", long_options, &optindex)) != -1)

src/bin/scripts/common.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.8 2004/05/25 01:00:27 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.9 2004/06/01 02:54:09 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -47,16 +47,6 @@ get_user_name(const char *progname)
4747
}
4848

4949

50-
/*
51-
* Initialized NLS if enabled.
52-
*/
53-
void
54-
init_nls(const char *argv0)
55-
{
56-
set_pglocale(argv0, "pgscripts");
57-
}
58-
59-
6050
/*
6151
* Provide strictly harmonized handling of --help and --version
6252
* options.

src/bin/scripts/common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ int optreset;
1111
const char *get_user_name(const char *progname);
1212

1313
#define _(x) gettext((x))
14-
void init_nls(const char *argv0);
1514

1615
typedef void (*help_handler) (const char *);
1716

src/bin/scripts/createdb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.9 2004/05/25 01:00:27 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.10 2004/06/01 02:54:09 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -60,7 +60,8 @@ main(int argc, char *argv[])
6060
PGresult *result;
6161

6262
progname = get_progname(argv[0]);
63-
init_nls(argv[0]);
63+
set_pglocale(argv[0], "pgscripts");
64+
6465
handle_help_version_opts(argc, argv, "createdb", help);
6566

6667
while ((c = getopt_long(argc, argv, "h:p:U:WeqO:D:T:E:", long_options, &optindex)) != -1)

src/bin/scripts/createlang.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/createlang.c,v 1.10 2004/05/25 01:00:27 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/createlang.c,v 1.11 2004/06/01 02:54:09 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -61,7 +61,8 @@ main(int argc, char *argv[])
6161
PGresult *result;
6262

6363
progname = get_progname(argv[0]);
64-
init_nls(argv[0]);
64+
set_pglocale(argv[0], "pgscripts");
65+
6566
handle_help_version_opts(argc, argv, "createlang", help);
6667

6768
while ((c = getopt_long(argc, argv, "lh:p:U:Wd:L:e", long_options, &optindex)) != -1)

src/bin/scripts/createuser.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.11 2004/05/25 01:00:27 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.12 2004/06/01 02:54:09 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -63,7 +63,8 @@ main(int argc, char *argv[])
6363
PGresult *result;
6464

6565
progname = get_progname(argv[0]);
66-
init_nls(argv[0]);
66+
set_pglocale(argv[0], "pgscripts");
67+
6768
handle_help_version_opts(argc, argv, "createuser", help);
6869

6970
while ((c = getopt_long(argc, argv, "h:p:U:WeqaAdDi:PEN", long_options, &optindex)) != -1)

src/bin/scripts/dropdb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/dropdb.c,v 1.10 2004/05/25 01:00:27 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/dropdb.c,v 1.11 2004/06/01 02:54:09 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -51,7 +51,8 @@ main(int argc, char *argv[])
5151
PGresult *result;
5252

5353
progname = get_progname(argv[0]);
54-
init_nls(argv[0]);
54+
set_pglocale(argv[0], "pgscripts");
55+
5556
handle_help_version_opts(argc, argv, "dropdb", help);
5657

5758
while ((c = getopt_long(argc, argv, "h:p:U:Weqi", long_options, &optindex)) != -1)

src/bin/scripts/droplang.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/droplang.c,v 1.9 2004/05/25 01:00:27 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/droplang.c,v 1.10 2004/06/01 02:54:09 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -61,7 +61,8 @@ main(int argc, char *argv[])
6161
PGresult *result;
6262

6363
progname = get_progname(argv[0]);
64-
init_nls(argv[0]);
64+
set_pglocale(argv[0], "pgscripts");
65+
6566
handle_help_version_opts(argc, argv, "droplang", help);
6667

6768
while ((c = getopt_long(argc, argv, "lh:p:U:Wd:e", long_options, &optindex)) != -1)

src/bin/scripts/dropuser.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/dropuser.c,v 1.9 2004/05/25 01:00:27 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/dropuser.c,v 1.10 2004/06/01 02:54:09 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -51,7 +51,8 @@ main(int argc, char *argv[])
5151
PGresult *result;
5252

5353
progname = get_progname(argv[0]);
54-
init_nls(argv[0]);
54+
set_pglocale(argv[0], "pgscripts");
55+
5556
handle_help_version_opts(argc, argv, "dropuser", help);
5657

5758
while ((c = getopt_long(argc, argv, "h:p:U:Weqi", long_options, &optindex)) != -1)

src/bin/scripts/vacuumdb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.7 2004/05/25 01:00:27 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.8 2004/06/01 02:54:09 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -66,7 +66,8 @@ main(int argc, char *argv[])
6666
bool verbose = false;
6767

6868
progname = get_progname(argv[0]);
69-
init_nls(argv[0]);
69+
set_pglocale(argv[0], "pgscripts");
70+
7071
handle_help_version_opts(argc, argv, "vacuumdb", help);
7172

7273
while ((c = getopt_long(argc, argv, "h:p:U:Weqd:zat:fv", long_options, &optindex)) != -1)

0 commit comments

Comments
 (0)