Skip to content

Commit

Permalink
Use scanner_isspace test instead test on space char.
Browse files Browse the repository at this point in the history
  • Loading branch information
okbob committed Jan 5, 2024
1 parent ae43c00 commit 5671953
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ get_token(TokenizerState *state, PragmaTokenType *token)
}

/* skip inital spaces */
while (*state->str == ' ')
while (scanner_isspace(*state->str))
state->str++;

if (!*state->str)
Expand Down
16 changes: 8 additions & 8 deletions src/pragma.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ PG_FUNCTION_INFO_V1(plpgsql_check_pragma);
static void
runtime_pragma_apply(char *pragma_str)
{
while (*pragma_str == ' ')
while (scanner_isspace(*pragma_str))
pragma_str++;

if (strncasecmp(pragma_str, "STATUS:", 7) == 0)
{
pragma_str += 7;

while (*pragma_str == ' ')
while (scanner_isspace(*pragma_str))
pragma_str++;

if (strcasecmp(pragma_str, "TRACER") == 0)
Expand All @@ -49,7 +49,7 @@ runtime_pragma_apply(char *pragma_str)
{
pragma_str += 7;

while (*pragma_str == ' ')
while (scanner_isspace(*pragma_str))
pragma_str++;

if (strcasecmp(pragma_str, "TRACER") == 0)
Expand All @@ -59,7 +59,7 @@ runtime_pragma_apply(char *pragma_str)
{
pragma_str += 8;

while (*pragma_str == ' ')
while (scanner_isspace(*pragma_str))
pragma_str++;

if (strcasecmp(pragma_str, "TRACER") == 0)
Expand All @@ -78,7 +78,7 @@ pragma_apply(PLpgSQL_checkstate *cstate,

Assert(cstate);

while (*pragma_str == ' ')
while (scanner_isspace(*pragma_str))
pragma_str++;

if (strncasecmp(pragma_str, "ECHO:", 5) == 0)
Expand All @@ -89,7 +89,7 @@ pragma_apply(PLpgSQL_checkstate *cstate,
{
pragma_str += 7;

while (*pragma_str == ' ')
while (scanner_isspace(*pragma_str))
pragma_str++;

if (strcasecmp(pragma_str, "CHECK") == 0)
Expand Down Expand Up @@ -126,7 +126,7 @@ pragma_apply(PLpgSQL_checkstate *cstate,
{
pragma_str += 7;

while (*pragma_str == ' ')
while (scanner_isspace(*pragma_str))
pragma_str++;

if (strcasecmp(pragma_str, "CHECK") == 0)
Expand Down Expand Up @@ -155,7 +155,7 @@ pragma_apply(PLpgSQL_checkstate *cstate,
{
pragma_str += 8;

while (*pragma_str == ' ')
while (scanner_isspace(*pragma_str))
pragma_str++;

if (strcasecmp(pragma_str, "CHECK") == 0)
Expand Down

0 comments on commit 5671953

Please sign in to comment.