Fix pg_dumpall to use double-quote for Win32 arguments.
authorBruce Momjian <bruce@momjian.us>
Wed, 6 Oct 2004 17:02:02 +0000 (17:02 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 6 Oct 2004 17:02:02 +0000 (17:02 +0000)
Luiz K. Matsumura

src/bin/pg_dump/pg_dumpall.c

index 1a9e4cdf16aba81353bcef9b77115d4ca609c122..df6041b04852507127ec0d74bb6a5df924647f15 100644 (file)
@@ -6,7 +6,7 @@
  * 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':
                pghost = optarg;
+#ifndef WIN32
                appendPQExpBuffer(pgdumpopts, " -h '%s'", pghost);
+#else
+                                appendPQExpBuffer(pgdumpopts, " -h \"%s\"", pghost);
+#endif
+
                break;
 
+
+
            case 'i':
            case 'o':
                appendPQExpBuffer(pgdumpopts, " -%c", c);
@@ -194,7 +201,11 @@ main(int argc, char *argv[])
 
            case 'p':
                pgport = optarg;
+#ifndef WIN32
                appendPQExpBuffer(pgdumpopts, " -p '%s'", pgport);
+#else
+                                appendPQExpBuffer(pgdumpopts, " -p \"%s\"", pgport);
+#endif
                break;
 
            case 's':
@@ -203,12 +214,20 @@ main(int argc, char *argv[])
                break;
 
            case 'S':
+#ifndef WIN32
                appendPQExpBuffer(pgdumpopts, " -S '%s'", optarg);
+#else
+                                appendPQExpBuffer(pgdumpopts, " -S \"%s\"", optarg);
+#endif
                break;
 
            case 'U':
                pguser = optarg;
+#ifndef WIN32
                appendPQExpBuffer(pgdumpopts, " -U '%s'", pguser);
+#else
+                                appendPQExpBuffer(pgdumpopts, " -U \"%s\"", pguser);
+#endif
                break;
 
            case 'v':