Compare only keys */
| 1754 | |
| 1755 | /* Compare only keys */ |
| 1756 | static 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 |
no test coverage detected