mirror of
https://github.com/postgres/postgres.git
synced 2025-09-05 02:22:28 +03:00
Standard pgindent run for 8.1.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/bin/psql/stringutils.c,v 1.40 2005/01/01 05:43:08 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/bin/psql/stringutils.c,v 1.41 2005/10/15 02:49:40 momjian Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
|
||||
@@ -58,10 +58,10 @@ strtokx(const char *s,
|
||||
bool del_quotes,
|
||||
int encoding)
|
||||
{
|
||||
static char *storage = NULL;/* store the local copy of the users
|
||||
* string here */
|
||||
static char *string = NULL; /* pointer into storage where to continue
|
||||
* on next call */
|
||||
static char *storage = NULL;/* store the local copy of the users string
|
||||
* here */
|
||||
static char *string = NULL; /* pointer into storage where to continue on
|
||||
* next call */
|
||||
|
||||
/* variously abused variables: */
|
||||
unsigned int offset;
|
||||
@@ -74,8 +74,8 @@ strtokx(const char *s,
|
||||
|
||||
/*
|
||||
* We may need extra space to insert delimiter nulls for adjacent
|
||||
* tokens. 2X the space is a gross overestimate, but it's
|
||||
* unlikely that this code will be used on huge strings anyway.
|
||||
* tokens. 2X the space is a gross overestimate, but it's unlikely
|
||||
* that this code will be used on huge strings anyway.
|
||||
*/
|
||||
storage = pg_malloc(2 * strlen(s) + 1);
|
||||
strcpy(storage, s);
|
||||
@@ -103,11 +103,11 @@ strtokx(const char *s,
|
||||
if (delim && strchr(delim, *start))
|
||||
{
|
||||
/*
|
||||
* If not at end of string, we need to insert a null to terminate
|
||||
* the returned token. We can just overwrite the next character
|
||||
* if it happens to be in the whitespace set ... otherwise move
|
||||
* over the rest of the string to make room. (This is why we
|
||||
* allocated extra space above).
|
||||
* If not at end of string, we need to insert a null to terminate the
|
||||
* returned token. We can just overwrite the next character if it
|
||||
* happens to be in the whitespace set ... otherwise move over the
|
||||
* rest of the string to make room. (This is why we allocated extra
|
||||
* space above).
|
||||
*/
|
||||
p = start + 1;
|
||||
if (*p != '\0')
|
||||
@@ -146,8 +146,8 @@ strtokx(const char *s,
|
||||
}
|
||||
|
||||
/*
|
||||
* If not at end of string, we need to insert a null to terminate
|
||||
* the returned token. See notes above.
|
||||
* If not at end of string, we need to insert a null to terminate the
|
||||
* returned token. See notes above.
|
||||
*/
|
||||
if (*p != '\0')
|
||||
{
|
||||
@@ -170,10 +170,9 @@ strtokx(const char *s,
|
||||
}
|
||||
|
||||
/*
|
||||
* Otherwise no quoting character. Scan till next whitespace,
|
||||
* delimiter or quote. NB: at this point, *start is known not to be
|
||||
* '\0', whitespace, delim, or quote, so we will consume at least one
|
||||
* character.
|
||||
* Otherwise no quoting character. Scan till next whitespace, delimiter
|
||||
* or quote. NB: at this point, *start is known not to be '\0',
|
||||
* whitespace, delim, or quote, so we will consume at least one character.
|
||||
*/
|
||||
offset = strcspn(start, whitespace);
|
||||
|
||||
|
Reference in New Issue
Block a user