Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dedb53f

Browse files
committed
Fix pg_dumpall to use double-quote for Win32 arguments.
Luiz K. Matsumura
1 parent 48018da commit dedb53f

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/bin/pg_dump/pg_dumpall.c

+20-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
88
*
9-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.51 2004/08/29 05:06:53 momjian Exp $
9+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.52 2004/10/06 17:02:02 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -180,9 +180,16 @@ main(int argc, char *argv[])
180180

181181
case 'h':
182182
pghost = optarg;
183+
#ifndef WIN32
183184
appendPQExpBuffer(pgdumpopts, " -h '%s'", pghost);
185+
#else
186+
appendPQExpBuffer(pgdumpopts, " -h \"%s\"", pghost);
187+
#endif
188+
184189
break;
185190

191+
192+
186193
case 'i':
187194
case 'o':
188195
appendPQExpBuffer(pgdumpopts, " -%c", c);
@@ -194,7 +201,11 @@ main(int argc, char *argv[])
194201

195202
case 'p':
196203
pgport = optarg;
204+
#ifndef WIN32
197205
appendPQExpBuffer(pgdumpopts, " -p '%s'", pgport);
206+
#else
207+
appendPQExpBuffer(pgdumpopts, " -p \"%s\"", pgport);
208+
#endif
198209
break;
199210

200211
case 's':
@@ -203,12 +214,20 @@ main(int argc, char *argv[])
203214
break;
204215

205216
case 'S':
217+
#ifndef WIN32
206218
appendPQExpBuffer(pgdumpopts, " -S '%s'", optarg);
219+
#else
220+
appendPQExpBuffer(pgdumpopts, " -S \"%s\"", optarg);
221+
#endif
207222
break;
208223

209224
case 'U':
210225
pguser = optarg;
226+
#ifndef WIN32
211227
appendPQExpBuffer(pgdumpopts, " -U '%s'", pguser);
228+
#else
229+
appendPQExpBuffer(pgdumpopts, " -U \"%s\"", pguser);
230+
#endif
212231
break;
213232

214233
case 'v':

0 commit comments

Comments
 (0)