MCPcopy Create free account
hub / github.com/F-Stack/f-stack / isescaped

Function isescaped

tools/libutil/fparseln.c:51–72  ·  view source on GitHub ↗

isescaped(): * Return true if the character in *p that belongs to a string * that starts in *sp, is escaped by the escape character esc. */

Source from the content-addressed store, hash-verified

49 * that starts in *sp, is escaped by the escape character esc.
50 */
51static int
52isescaped(const char *sp, const char *p, int esc)
53{
54 const char *cp;
55 size_t ne;
56
57#if 0
58 _DIAGASSERT(sp != NULL);
59 _DIAGASSERT(p != NULL);
60#endif
61
62 /* No escape character */
63 if (esc == '\0')
64 return 0;
65
66 /* Count the number of escape characters that precede ours */
67 for (ne = 0, cp = p; --cp >= sp && *cp == esc; ne++)
68 continue;
69
70 /* Return true if odd number of escape characters */
71 return (ne & 1) != 0;
72}
73
74
75/* fparseln():

Callers 1

fparselnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected