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

Function wenvcmp

compat/mingw.c:1756–1772  ·  view source on GitHub ↗

Compare only keys */

Source from the content-addressed store, hash-verified

1754
1755/* Compare only keys */
1756static int wenvcmp(const void *a, const void *b)
1757{
1758 wchar_t *p = *(wchar_t **)a, *q = *(wchar_t **)b;
1759 size_t p_len, q_len;
1760
1761 /* Find the keys */
1762 p_len = wcschrnul(p, L'=') - p;
1763 q_len = wcschrnul(q, L'=') - q;
1764
1765 /* If the length differs, include the shorter key's NUL */
1766 if (p_len < q_len)
1767 p_len++;
1768 else if (p_len > q_len)
1769 p_len = q_len + 1;
1770
1771 return _wcsnicmp(p, q, p_len);
1772}
1773
1774/*
1775 * Build an environment block combining the inherited environment

Callers 1

make_environment_blockFunction · 0.85

Calls 1

wcschrnulFunction · 0.85

Tested by

no test coverage detected