MCPcopy Create free account
hub / github.com/apache/cloudberry / debackslash

Function debackslash

src/backend/nodes/read.c:240–255  ·  view source on GitHub ↗

* debackslash - * create a palloc'd string holding the given token. * any protective backslashes in the token are removed. */

Source from the content-addressed store, hash-verified

238 * any protective backslashes in the token are removed.
239 */
240char *
241debackslash(const char *token, int length)
242{
243 char *result = palloc(length + 1);
244 char *ptr = result;
245
246 while (length > 0)
247 {
248 if (*token == '\\' && length > 1)
249 token++, length--;
250 *ptr++ = *token++;
251 length--;
252 }
253 *ptr = '\0';
254 return result;
255}
256
257#define RIGHT_PAREN (1000000 + 1)
258#define LEFT_PAREN (1000000 + 2)

Callers 2

_readAConstFunction · 0.85
nodeReadFunction · 0.85

Calls 1

pallocFunction · 0.50

Tested by

no test coverage detected