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

Function strwiEQ

loadparm.c:282–304  ·  view source on GitHub ↗

Do a case-insensitive, whitespace-ignoring string equality check. */

Source from the content-addressed store, hash-verified

280
281/* Do a case-insensitive, whitespace-ignoring string equality check. */
282static int strwiEQ(char *psz1, char *psz2)
283{
284 /* If one or both strings are NULL, we return equality right away. */
285 if (psz1 == psz2)
286 return 1;
287 if (psz1 == NULL || psz2 == NULL)
288 return 0;
289
290 /* sync the strings on first non-whitespace */
291 while (1) {
292 while (isSpace(psz1))
293 psz1++;
294 while (isSpace(psz2))
295 psz2++;
296 if (*psz1 == '\0' || *psz2 == '\0')
297 break;
298 if (toUpper(psz1) != toUpper(psz2))
299 break;
300 psz1++;
301 psz2++;
302 }
303 return *psz1 == *psz2;
304}
305
306/* Find a section by name. Otherwise works like get_section. */
307static int getsectionbyname(char *name)

Callers 4

getsectionbynameFunction · 0.85
map_parameterFunction · 0.85
set_booleanFunction · 0.85
do_sectionFunction · 0.85

Calls 2

isSpaceFunction · 0.85
toUpperFunction · 0.85

Tested by

no test coverage detected