Fix check for -d/--dbname parameter

Not a bug per-se, just meant some unnecessary processing was done on
an empty string.

Per note from petere.
This commit is contained in:
Ian Barwick
2018-05-10 11:57:02 +09:00
parent bd63948937
commit b365765bc8

View File

@@ -634,7 +634,7 @@ main(int argc, char **argv)
* If -d/--dbname appears to be a conninfo string, validate by attempting
* to parse it (and if successful, store the parsed parameters)
*/
if (runtime_options.dbname)
if (runtime_options.dbname[0])
{
if (strncmp(runtime_options.dbname, "postgresql://", 13) == 0 ||
strncmp(runtime_options.dbname, "postgres://", 11) == 0 ||