Fix pg_dumpall to use double-quote for Win32 arguments.

Luiz K. Matsumura
This commit is contained in:
Bruce Momjian 2004-10-06 17:02:02 +00:00
parent 48018da7ce
commit dedb53f29c
1 changed files with 20 additions and 1 deletions

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* *
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.51 2004/08/29 05:06:53 momjian Exp $ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.52 2004/10/06 17:02:02 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -180,9 +180,16 @@ main(int argc, char *argv[])
case 'h': case 'h':
pghost = optarg; pghost = optarg;
#ifndef WIN32
appendPQExpBuffer(pgdumpopts, " -h '%s'", pghost); appendPQExpBuffer(pgdumpopts, " -h '%s'", pghost);
#else
appendPQExpBuffer(pgdumpopts, " -h \"%s\"", pghost);
#endif
break; break;
case 'i': case 'i':
case 'o': case 'o':
appendPQExpBuffer(pgdumpopts, " -%c", c); appendPQExpBuffer(pgdumpopts, " -%c", c);
@ -194,7 +201,11 @@ main(int argc, char *argv[])
case 'p': case 'p':
pgport = optarg; pgport = optarg;
#ifndef WIN32
appendPQExpBuffer(pgdumpopts, " -p '%s'", pgport); appendPQExpBuffer(pgdumpopts, " -p '%s'", pgport);
#else
appendPQExpBuffer(pgdumpopts, " -p \"%s\"", pgport);
#endif
break; break;
case 's': case 's':
@ -203,12 +214,20 @@ main(int argc, char *argv[])
break; break;
case 'S': case 'S':
#ifndef WIN32
appendPQExpBuffer(pgdumpopts, " -S '%s'", optarg); appendPQExpBuffer(pgdumpopts, " -S '%s'", optarg);
#else
appendPQExpBuffer(pgdumpopts, " -S \"%s\"", optarg);
#endif
break; break;
case 'U': case 'U':
pguser = optarg; pguser = optarg;
#ifndef WIN32
appendPQExpBuffer(pgdumpopts, " -U '%s'", pguser); appendPQExpBuffer(pgdumpopts, " -U '%s'", pguser);
#else
appendPQExpBuffer(pgdumpopts, " -U \"%s\"", pguser);
#endif
break; break;
case 'v': case 'v':