mirror of https://github.com/djcb/mu.git
* lib/mu-contacts: make address comparison case-insensitive
This commit is contained in:
parent
63e8ecb649
commit
58a90e4a5d
|
@ -72,8 +72,10 @@ encode_email_address (const char *addr)
|
||||||
|
|
||||||
/* make sure chars are with {' ' .. '~'}, and not '[' ']' */
|
/* make sure chars are with {' ' .. '~'}, and not '[' ']' */
|
||||||
for (cur = strncpy(enc, addr, sizeof(enc)); *cur != '\0'; ++cur)
|
for (cur = strncpy(enc, addr, sizeof(enc)); *cur != '\0'; ++cur)
|
||||||
if (!isalnum(*cur))
|
if (!isalnum(*cur)) {
|
||||||
*cur = 'A' + (*cur % ('Z' - 'A'));
|
*cur = 'A' + (*cur % ('Z' - 'A'));
|
||||||
|
} else
|
||||||
|
*cur = tolower(*cur);
|
||||||
|
|
||||||
return enc;
|
return enc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue