MCPcopy Create free account
hub / github.com/git/git / next_quote_pos

Function next_quote_pos

quote.c:226–235  ·  view source on GitHub ↗

returns the longest prefix not needing a quote up to maxlen if positive. This stops at the first \0 because it's marked as a character needing an escape */

Source from the content-addressed store, hash-verified

224 This stops at the first \0 because it's marked as a character needing an
225 escape */
226static size_t next_quote_pos(const char *s, ssize_t maxlen)
227{
228 size_t len;
229 if (maxlen < 0) {
230 for (len = 0; !cq_must_quote(s[len]); len++);
231 } else {
232 for (len = 0; len < maxlen && !cq_must_quote(s[len]); len++);
233 }
234 return len;
235}
236
237/*
238 * C-style name quoting.

Callers 1

quote_c_style_countedFunction · 0.85

Calls 1

cq_must_quoteFunction · 0.85

Tested by

no test coverage detected