mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
Simplify 'pg_ctl restart' detection of first argument in
postmaster.opts.
This commit is contained in:
parent
54b9a968ed
commit
7cc1fb4768
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
* 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");
|
len = strcspn(optline, "\r\n");
|
||||||
optline[len] = '\0';
|
optline[len] = '\0';
|
||||||
|
|
||||||
for (arg1 = optline; *arg1; arg1++)
|
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
* Are we at the first option, as defined by space,
|
* Are we at the first option, as defined by space and
|
||||||
* double-quote, and a dash?
|
* double-quote?
|
||||||
*/
|
*/
|
||||||
if (*arg1 == ' ' && *(arg1+1) == '"' && *(arg1+2) == '-')
|
if ((arg1 = strstr(optline, " \"")) != NULL)
|
||||||
{
|
{
|
||||||
*arg1 = '\0'; /* terminate so we get only program name */
|
*arg1 = '\0'; /* terminate so we get only program name */
|
||||||
post_opts = arg1 + 1; /* point past whitespace */
|
post_opts = arg1 + 1; /* point past whitespace */
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (postgres_path != NULL)
|
if (postgres_path != NULL)
|
||||||
postgres_path = optline;
|
postgres_path = optline;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user