From: Marko Kreen Date: Sun, 7 Dec 2008 09:15:37 +0000 (+0000) Subject: win32: more fixes X-Git-Tag: pgbouncer_1_3_rc1~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=202f6b3abd3f71e2a8f6b351ccb72d88648834c5;p=pgbouncer win32: more fixes - proper message id - fix bugs in cmdline validation --- diff --git a/src/main.c b/src/main.c index 5e0a318..2209cfc 100644 --- a/src/main.c +++ b/src/main.c @@ -665,8 +665,10 @@ int main(int argc, char *argv[]) usage(1, argv[0]); } } - if (optind + 1 != argc) - usage(1, argv[0]); + if (optind + 1 != argc) { + fprintf(stderr, "Need config file. See pgbouncer -h for usage.\n"); + exit(1); + } cf_config_file = argv[optind]; init_objects(); diff --git a/win32/eventmsg.mc b/win32/eventmsg.mc index 11a430f..085c629 100644 --- a/win32/eventmsg.mc +++ b/win32/eventmsg.mc @@ -1,5 +1,5 @@ MessageId=0 -SymbolicName=0x00000000L +SymbolicName=MSG_PGBOUNCER Language=English %1 . diff --git a/win32/eventmsg.rc b/win32/eventmsg.rc index 0885a89..a928b13 100644 --- a/win32/eventmsg.rc +++ b/win32/eventmsg.rc @@ -1,2 +1,2 @@ -LANGUAGE 0x9,0x1 -1 11 MSG00001.bin +LANGUAGE 0x9,0x1 +1 11 "MSG00001.bin" diff --git a/win32/win32support.c b/win32/win32support.c index 34788d5..b24992e 100644 --- a/win32/win32support.c +++ b/win32/win32support.c @@ -45,8 +45,8 @@ static char **children_config_files; static const char *usage_str = "Usage: %s [OPTION]... config.ini\n" +" -q No console messages\n" " -v Increase verbosity\n" -" -u Assume identity of \n" " -V Show version\n" " -h Show this help screen and exit\n" " \n" @@ -660,12 +660,14 @@ int main(int argc, char *argv[]) /* check if regular arguments are in allowed list */ for (i = 1; i < argc; i++) { - char *p = argv[0]; + char *p = argv[i]; if (p[0] != '-') continue; for (j = 1; p[j]; j++) { - if (!strchr("avhV", p[j])) + if (!strchr("qvhV", p[j])) usage(1, argv[0]); + if (p[j] == 'h') + usage(0, argv[0]); } }