aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2008-06-26 03:51:56 +0000
committerBruce Momjian <bruce@momjian.us>2008-06-26 03:51:56 +0000
commit7cc1fb4768c6a0fbdb76ab098181ee93315862df (patch)
tree7e006b98f92883a07040c5e0286b23f54ca5ef5a /src
parent54b9a968ed318def5baba4644de537efb52d3e85 (diff)
downloadpostgresql-7cc1fb4768c6a0fbdb76ab098181ee93315862df.tar.gz
postgresql-7cc1fb4768c6a0fbdb76ab098181ee93315862df.zip
Simplify 'pg_ctl restart' detection of first argument in
postmaster.opts.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_ctl/pg_ctl.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 310d1775d2b..58fae74adee 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-2008, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.101 2008/06/26 02:47:19 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.102 2008/06/26 03:51:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -601,18 +601,14 @@ read_post_opts(void)
len = strcspn(optline, "\r\n");
optline[len] = '\0';
- for (arg1 = optline; *arg1; arg1++)
+ /*
+ * Are we at the first option, as defined by space and
+ * double-quote?
+ */
+ if ((arg1 = strstr(optline, " \"")) != NULL)
{
- /*
- * Are we at the first option, as defined by space,
- * double-quote, and a dash?
- */
- if (*arg1 == ' ' && *(arg1+1) == '"' && *(arg1+2) == '-')
- {
- *arg1 = '\0'; /* terminate so we get only program name */
- post_opts = arg1 + 1; /* point past whitespace */
- break;
- }
+ *arg1 = '\0'; /* terminate so we get only program name */
+ post_opts = arg1 + 1; /* point past whitespace */
}
if (postgres_path != NULL)
postgres_path = optline;