MCPcopy Create free account
hub / github.com/RsyncProject/rsync / litmatch_array

Function litmatch_array

lib/wildmatch.c:354–368  ·  view source on GitHub ↗

Match literal string "s" against the a virtually-joined string consisting * of all the pointers in array "texts" (which has a NULL pointer at the * end). The int "where" can be 0 (normal matching), or > 0 (match * only the trailing N slash-separated filename components of "texts"). */

Source from the content-addressed store, hash-verified

352 * end). The int "where" can be 0 (normal matching), or > 0 (match
353 * only the trailing N slash-separated filename components of "texts"). */
354int litmatch_array(const char *string, const char*const *texts, int where)
355{
356 const uchar *s = (const uchar*)string;
357 const uchar*const *a = (const uchar* const*)texts;
358 const uchar *text;
359
360 if (where > 0)
361 text = trailing_N_elements(&a, where);
362 else
363 text = *a++;
364 if (!text)
365 return FALSE;
366
367 return doliteral(s, text, a) == TRUE;
368}

Callers 1

rule_matchesFunction · 0.85

Calls 2

trailing_N_elementsFunction · 0.85
doliteralFunction · 0.85

Tested by

no test coverage detected