Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1c5531b

Browse files
committed
Tweak command quoting for Windows (I'd forgotten about SYSTEMQUOTE).
1 parentbcee9e8 commit1c5531b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

‎src/test/regress/pg_regress.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.1 2006/07/1902:37:00 tgl Exp $
14+
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.2 2006/07/1904:50:57 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -197,7 +197,7 @@ stop_postmaster(void)
197197
charbuf[MAXPGPATH*2];
198198

199199
snprintf(buf,sizeof(buf),
200-
"\"%s/pg_ctl\" stop -D \"%s/data\" -s -m fast",
200+
SYSTEMQUOTE"\"%s/pg_ctl\" stop -D \"%s/data\" -s -m fast"SYSTEMQUOTE,
201201
bindir,temp_install);
202202
system(buf);/* ignore exit status */
203203
postmaster_running= false;
@@ -589,7 +589,7 @@ psql_command(const char *database, const char *query, ...)
589589

590590
/* And now we can build and execute the shell command */
591591
snprintf(psql_cmd,sizeof(psql_cmd),
592-
"\"%s/psql\" -X -c \"%s\" \"%s\"",
592+
SYSTEMQUOTE"\"%s/psql\" -X -c \"%s\" \"%s\""SYSTEMQUOTE,
593593
bindir,query_escaped,database);
594594

595595
if (system(psql_cmd)!=0)
@@ -676,7 +676,7 @@ psql_start_test(const char *testname)
676676
outputdir,testname);
677677

678678
snprintf(psql_cmd,sizeof(psql_cmd),
679-
"\"%s/psql\" -X -a -q -d \"%s\" <\"%s\" >\"%s\" 2>&1",
679+
SYSTEMQUOTE"\"%s/psql\" -X -a -q -d \"%s\" <\"%s\" >\"%s\" 2>&1"SYSTEMQUOTE,
680680
bindir,dbname,infile,outfile);
681681

682682
pid=spawn_process(psql_cmd);
@@ -819,7 +819,7 @@ results_differ(const char *testname)
819819

820820
/* OK, run the diff */
821821
snprintf(cmd,sizeof(cmd),
822-
"diff %s \"%s\" \"%s\" >\"%s\"",
822+
SYSTEMQUOTE"diff %s \"%s\" \"%s\" >\"%s\""SYSTEMQUOTE,
823823
basic_diff_opts,expectfile,resultsfile,diff);
824824
r=system(cmd);
825825
if (!WIFEXITED(r)||WEXITSTATUS(r)>1)
@@ -848,7 +848,7 @@ results_differ(const char *testname)
848848
continue;
849849

850850
snprintf(cmd,sizeof(cmd),
851-
"diff %s \"%s\" \"%s\" >\"%s\"",
851+
SYSTEMQUOTE"diff %s \"%s\" \"%s\" >\"%s\""SYSTEMQUOTE,
852852
basic_diff_opts,expectfile,resultsfile,diff);
853853
r=system(cmd);
854854
if (!WIFEXITED(r)||WEXITSTATUS(r)>1)
@@ -878,7 +878,7 @@ results_differ(const char *testname)
878878
* we append to the diffs summary file.
879879
*/
880880
snprintf(cmd,sizeof(cmd),
881-
"diff %s \"%s\" \"%s\" >>\"%s\"",
881+
SYSTEMQUOTE"diff %s \"%s\" \"%s\" >>\"%s\""SYSTEMQUOTE,
882882
pretty_diff_opts,best_expect_file,resultsfile,difffilename);
883883
r=system(cmd);
884884
if (!WIFEXITED(r)||WEXITSTATUS(r)>1)
@@ -1391,8 +1391,8 @@ main(int argc, char *argv[])
13911391

13921392
/* "make install" */
13931393
snprintf(buf,sizeof(buf),
1394-
"\"%s\" -C \"%s\" DESTDIR=\"%s/install\" install with_perl=no with_python=no >\"%s/log/install.log\" 2>&1",
1395-
makeprog,top_builddir,temp_install,outputdir);
1394+
SYSTEMQUOTE"\"%s\" -C \"%s\" DESTDIR=\"%s/install\" install with_perl=no with_python=no >\"%s/log/install.log\" 2>&1"SYSTEMQUOTE,
1395+
makeprog,top_builddir,temp_install,outputdir);
13961396
if (system(buf))
13971397
{
13981398
fprintf(stderr,_("\n%s: installation failed\nExamine %s/log/install.log for the reason.\n"),progname,outputdir);
@@ -1402,7 +1402,7 @@ main(int argc, char *argv[])
14021402
/* initdb */
14031403
header(_("initializing database system"));
14041404
snprintf(buf,sizeof(buf),
1405-
"\"%s/initdb\" -D \"%s/data\" -L \"%s\" --noclean %s %s >\"%s/log/initdb.log\" 2>&1",
1405+
SYSTEMQUOTE"\"%s/initdb\" -D \"%s/data\" -L \"%s\" --noclean %s %s >\"%s/log/initdb.log\" 2>&1"SYSTEMQUOTE,
14061406
bindir,temp_install,datadir,
14071407
debug ?"--debug" :"",
14081408
nolocale ?"--no-locale" :"",
@@ -1418,7 +1418,7 @@ main(int argc, char *argv[])
14181418
*/
14191419
header(_("starting postmaster"));
14201420
snprintf(buf,sizeof(buf),
1421-
"\"%s/postmaster\" -D \"%s/data\" -F %s -c \"listen_addresses=%s\" >\"%s/log/postmaster.log\" 2>&1",
1421+
SYSTEMQUOTE"\"%s/postmaster\" -D \"%s/data\" -F %s -c \"listen_addresses=%s\" >\"%s/log/postmaster.log\" 2>&1"SYSTEMQUOTE,
14221422
bindir,temp_install,
14231423
debug ?"-d 5" :"",
14241424
hostname ?hostname :"",
@@ -1445,7 +1445,7 @@ main(int argc, char *argv[])
14451445
* wait forever, however.
14461446
*/
14471447
snprintf(buf,sizeof(buf),
1448-
"\"%s/psql\" -X postgres <%s 2>%s",
1448+
SYSTEMQUOTE"\"%s/psql\" -X postgres <%s 2>%s"SYSTEMQUOTE,
14491449
bindir,DEVNULL,DEVNULL);
14501450
for (i=0;i<60;i++)
14511451
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp