repmgr: fix command line parsing with hostname as an additional argument

Check explicitly whether -h/--hostname provided, otherwise PGHOST,
if set, will be misinterpreted.
This commit is contained in:
Ian Barwick
2017-03-14 22:52:15 +09:00
parent 29740dc41b
commit 05bfdfab2c

View File

@@ -758,7 +758,7 @@ main(int argc, char **argv)
{ {
if (optind < argc) if (optind < argc)
{ {
if (runtime_options.host[0]) if (runtime_options.host_param_provided == true)
{ {
PQExpBufferData additional_host_arg; PQExpBufferData additional_host_arg;
initPQExpBuffer(&additional_host_arg); initPQExpBuffer(&additional_host_arg);