MCPcopy Index your code
hub / github.com/IBM/Project_CodeNet / JSON_unescape

Function JSON_unescape

tools/json-graph/src/jsonml2jgf.c:178–191  ·  view source on GitHub ↗

Undo JSON escaping: \\ => \. */

Source from the content-addressed store, hash-verified

176
177/* Undo JSON escaping: \\ => \. */
178static void JSON_unescape(jsmntok_t *tok)
179{
180 char *last = (char *)input + tok->start;
181 const char *p = last;
182 const char *end = input + tok->end;
183 for (; p < end; p++) {
184 if (*p == '\\' && (*(p+1) == '\\' || *(p+1) == '"')) {
185 *last++ = *++p;
186 tok->end--;
187 continue;
188 }
189 *last++ = *p;
190 }
191}
192
193// Escape token for output as CSV string.
194static void CSV_escape(FILE *fp, jsmntok_t *tok)

Callers 1

show_tokens_auxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected