aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/postmaster.c4
-rw-r--r--src/bin/pg_ctl/pg_ctl.c19
2 files changed, 13 insertions, 10 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 8c54471586f..5a107a78f4b 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.475.2.9 2007/08/02 23:18:47 adunstan Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.475.2.10 2008/06/27 01:53:08 momjian Exp $
*
* NOTES
*
@@ -3640,7 +3640,7 @@ CreateOptsFile(int argc, char *argv[], char *fullprogname)
fprintf(fp, "%s", fullprogname);
for (i = 1; i < argc; i++)
- fprintf(fp, " %s%s%s", SYSTEMQUOTE, argv[i], SYSTEMQUOTE);
+ fprintf(fp, " \"%s\"", argv[i]);
fputs("\n", fp);
if (fclose(fp))
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index ded748d2c11..b2cc19ee880 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -4,7 +4,7 @@
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.61.2.4 2008/02/20 22:18:35 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.61.2.5 2008/06/27 01:53:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -537,15 +537,18 @@ do_start(void)
{
char *arg1;
- arg1 = strchr(optline, *SYSTEMQUOTE);
- if (arg1 == NULL || arg1 == optline)
- post_opts = "";
- else
+ /*
+ * Are we at the first option, as defined by space and
+ * double-quote?
+ */
+ if ((arg1 = strstr(optline, " \"")) != NULL ||
+ /* check in case this is an older server */
+ (arg1 = strstr(optline, " -")) != NULL)
{
- *(arg1 - 1) = '\0'; /* this should be a space */
- post_opts = arg1;
+ *arg1 = '\0'; /* terminate so we get only program name */
+ post_opts = arg1 + 1; /* point past whitespace */
}
- if (postgres_path != NULL)
+ if (postgres_path == NULL)
postgres_path = optline;
}
else