patterns, for clarity.
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.559 2008/06/19 21:32:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.560 2008/06/26 01:35:45 momjian Exp $
*
* NOTES
*
fprintf(fp, "%s", fullprogname);
for (i = 1; i < argc; i++)
- fprintf(fp, " %s%s%s", SYSTEMQUOTE, argv[i], SYSTEMQUOTE);
+ fprintf(fp, " " SYSTEMQUOTE "%s" SYSTEMQUOTE, argv[i]);
fputs("\n", fp);
if (fclose(fp))
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.156 2008/06/02 03:48:00 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.157 2008/06/26 01:35:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
test_max_fsm = FSM_FOR_BUFS(test_buffs);
snprintf(cmd, sizeof(cmd),
- "%s\"%s\" --boot -x0 %s "
+ SYSTEMQUOTE "\"%s\" --boot -x0 %s "
"-c max_connections=%d "
"-c shared_buffers=%d "
"-c max_fsm_pages=%d "
- "< \"%s\" > \"%s\" 2>&1%s",
- SYSTEMQUOTE, backend_exec, boot_options,
+ "< \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE,
+ backend_exec, boot_options,
test_conns, test_buffs, test_max_fsm,
- DEVNULL, DEVNULL, SYSTEMQUOTE);
+ DEVNULL, DEVNULL);
status = system(cmd);
if (status == 0)
{
test_max_fsm = FSM_FOR_BUFS(test_buffs);
snprintf(cmd, sizeof(cmd),
- "%s\"%s\" --boot -x0 %s "
+ SYSTEMQUOTE "\"%s\" --boot -x0 %s "
"-c max_connections=%d "
"-c shared_buffers=%d "
"-c max_fsm_pages=%d "
- "< \"%s\" > \"%s\" 2>&1%s",
- SYSTEMQUOTE, backend_exec, boot_options,
+ "< \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE,
+ backend_exec, boot_options,
n_connections, test_buffs, test_max_fsm,
- DEVNULL, DEVNULL, SYSTEMQUOTE);
+ DEVNULL, DEVNULL);
status = system(cmd);
if (status == 0)
break;
*
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.99 2008/06/26 01:12:20 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.100 2008/06/26 01:35:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* everything to a shell to process them.
*/
if (log_file != NULL)
- snprintf(cmd, MAXPGPATH, "%s\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1 &%s",
- SYSTEMQUOTE, postgres_path, pgdata_opt, post_opts,
- DEVNULL, log_file, SYSTEMQUOTE);
+ snprintf(cmd, MAXPGPATH, SYSTEMQUOTE "\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1 &" SYSTEMQUOTE,
+ postgres_path, pgdata_opt, post_opts,
+ DEVNULL, log_file);
else
- snprintf(cmd, MAXPGPATH, "%s\"%s\" %s%s < \"%s\" 2>&1 &%s",
- SYSTEMQUOTE, postgres_path, pgdata_opt, post_opts,
- DEVNULL, SYSTEMQUOTE);
+ snprintf(cmd, MAXPGPATH, SYSTEMQUOTE "\"%s\" %s%s < \"%s\" 2>&1 &" SYSTEMQUOTE,
+ postgres_path, pgdata_opt, post_opts, DEVNULL);
return system(cmd);
#else /* WIN32 */
PROCESS_INFORMATION pi;
if (log_file != NULL)
- snprintf(cmd, MAXPGPATH, "CMD /C %s\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1%s",
- SYSTEMQUOTE, postgres_path, pgdata_opt, post_opts,
- DEVNULL, log_file, SYSTEMQUOTE);
+ snprintf(cmd, MAXPGPATH, "CMD /C " SYSTEMQUOTE "\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1" SYSTEMQUOTE,
+ postgres_path, pgdata_opt, post_opts, DEVNULL, log_file);
else
- snprintf(cmd, MAXPGPATH, "CMD /C %s\"%s\" %s%s < \"%s\" 2>&1%s",
- SYSTEMQUOTE, postgres_path, pgdata_opt, post_opts,
- DEVNULL, SYSTEMQUOTE);
+ snprintf(cmd, MAXPGPATH, "CMD /C " SYSTEMQUOTE "\"%s\" %s%s < \"%s\" 2>&1" SYSTEMQUOTE,
+ postgres_path, pgdata_opt, post_opts, DEVNULL);
if (!CreateRestrictedProcess(cmd, &pi))
return GetLastError();
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.104 2008/04/13 03:49:22 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.105 2008/06/26 01:35:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
if (filename)
{
#ifndef WIN32
- appendPQExpBuffer(cmd, "%s\"%s\" %s -Fa '", SYSTEMQUOTE, pg_dump_bin,
+ appendPQExpBuffer(cmd, SYSTEMQUOTE"\"%s\" %s -Fa '", pg_dump_bin,
#else
- appendPQExpBuffer(cmd, "%s\"%s\" %s -Fa \"", SYSTEMQUOTE, pg_dump_bin,
+ appendPQExpBuffer(cmd, SYSTEMQUOTE"\"%s\" %s -Fa \"", pg_dump_bin,
#endif
pgdumpopts->data);
}
else
{
#ifndef WIN32
- appendPQExpBuffer(cmd, "%s\"%s\" %s -Fp '", SYSTEMQUOTE, pg_dump_bin,
+ appendPQExpBuffer(cmd, SYSTEMQUOTE "\"%s\" %s -Fp '", pg_dump_bin,
#else
- appendPQExpBuffer(cmd, "%s\"%s\" %s -Fp \"", SYSTEMQUOTE, pg_dump_bin,
+ appendPQExpBuffer(cmd, SYSTEMQUOTE "\"%s\" %s -Fp \"", pg_dump_bin,
#endif
pgdumpopts->data);
}
*
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.190 2008/06/11 10:48:17 heikki Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.191 2008/06/26 01:35:45 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
#ifndef WIN32
sprintf(sys, "exec %s '%s'", editorName, fname);
#else
- sprintf(sys, "%s\"%s\" \"%s\"%s",
- SYSTEMQUOTE, editorName, fname, SYSTEMQUOTE);
+ sprintf(sys, SYSTEMQUOTE "\"%s\" \"%s\"" SYSTEMQUOTE, editorName, fname);
#endif
result = system(sys);
if (result == -1)
/* See EDITOR handling comment for an explaination */
"exec %s", shellName);
#else
- sprintf(sys,
/* See EDITOR handling comment for an explaination */
- "%s\"%s\"%s", SYSTEMQUOTE, shellName, SYSTEMQUOTE);
+ sprintf(sys, SYSTEMQUOTE "\"%s\"" SYSTEMQUOTE, shellName);
#endif
result = system(sys);
free(sys);