diff options
author | Peter Eisentraut | 2015-12-23 03:43:46 +0000 |
---|---|---|
committer | Peter Eisentraut | 2015-12-23 03:43:46 +0000 |
commit | 30c0c4bf12cc56a7a6c2b7f874e2cd4c95cd3491 (patch) | |
tree | 4ba34b1c7ea112f505608c7d378eed264264223a /src/backend/utils/adt | |
parent | 6efbded6e4672c597a6f0dc0f09263e7db7369ff (diff) |
Remove unnecessary escaping in C character literals
'\"' is more commonly written simply as '"'.
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r-- | src/backend/utils/adt/arrayfuncs.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/json.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/rangetypes.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/rowtypes.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/varlena.c | 12 |
5 files changed, 14 insertions, 14 deletions
diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index 359fb1462bc..72d308a5977 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -515,7 +515,7 @@ ArrayCount(const char *str, int *dim, char typdelim) errmsg("malformed array literal: \"%s\"", str), errdetail("Unexpected end of input."))); break; - case '\"': + case '"': /* * A quote must be after a level start, after a quoted @@ -799,7 +799,7 @@ ReadArrayStr(char *arrayStr, dstendptr = dstptr; hasquoting = true; /* can't be a NULL marker */ break; - case '\"': + case '"': in_quotes = !in_quotes; if (in_quotes) leadingspace = false; diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index af97fc1eff4..a54604ee9df 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -2415,7 +2415,7 @@ escape_json(StringInfo buf, const char *str) { const char *p; - appendStringInfoCharMacro(buf, '\"'); + appendStringInfoCharMacro(buf, '"'); for (p = str; *p; p++) { switch (*p) @@ -2449,7 +2449,7 @@ escape_json(StringInfo buf, const char *str) break; } } - appendStringInfoCharMacro(buf, '\"'); + appendStringInfoCharMacro(buf, '"'); } /* diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c index 88f857b509f..21e386c279e 100644 --- a/src/backend/utils/adt/rangetypes.c +++ b/src/backend/utils/adt/rangetypes.c @@ -2132,11 +2132,11 @@ range_parse_bound(const char *string, const char *ptr, errdetail("Unexpected end of input."))); appendStringInfoChar(&buf, *ptr++); } - else if (ch == '\"') + else if (ch == '"') { if (!inquote) inquote = true; - else if (*ptr == '\"') + else if (*ptr == '"') { /* doubled quote within quote sequence */ appendStringInfoChar(&buf, *ptr++); diff --git a/src/backend/utils/adt/rowtypes.c b/src/backend/utils/adt/rowtypes.c index e1c72a12324..567622f759a 100644 --- a/src/backend/utils/adt/rowtypes.c +++ b/src/backend/utils/adt/rowtypes.c @@ -216,11 +216,11 @@ record_in(PG_FUNCTION_ARGS) errdetail("Unexpected end of input."))); appendStringInfoChar(&buf, *ptr++); } - else if (ch == '\"') + else if (ch == '"') { if (!inquote) inquote = true; - else if (*ptr == '\"') + else if (*ptr == '"') { /* doubled quote within quote sequence */ appendStringInfoChar(&buf, *ptr++); diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index a89f586abad..85f85d430e0 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -3007,16 +3007,16 @@ SplitIdentifierString(char *rawstring, char separator, char *curname; char *endp; - if (*nextp == '\"') + if (*nextp == '"') { /* Quoted name --- collapse quote-quote pairs, no downcasing */ curname = nextp + 1; for (;;) { - endp = strchr(nextp + 1, '\"'); + endp = strchr(nextp + 1, '"'); if (endp == NULL) return false; /* mismatched quotes */ - if (endp[1] != '\"') + if (endp[1] != '"') break; /* found end of quoted name */ /* Collapse adjacent quotes into one quote, and look again */ memmove(endp, endp + 1, strlen(endp)); @@ -3132,16 +3132,16 @@ SplitDirectoriesString(char *rawstring, char separator, char *curname; char *endp; - if (*nextp == '\"') + if (*nextp == '"') { /* Quoted name --- collapse quote-quote pairs */ curname = nextp + 1; for (;;) { - endp = strchr(nextp + 1, '\"'); + endp = strchr(nextp + 1, '"'); if (endp == NULL) return false; /* mismatched quotes */ - if (endp[1] != '\"') + if (endp[1] != '"') break; /* found end of quoted name */ /* Collapse adjacent quotes into one quote, and look again */ memmove(endp, endp + 1, strlen(endp)); |