aboutsummaryrefslogtreecommitdiffstats
path: root/common/stringhelp.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-02-26 17:16:45 +0000
committerWerner Koch <[email protected]>2015-02-26 17:16:45 +0000
commitc071be698efadef1ad01fd3d329d1b486a372927 (patch)
treedcf999a07b3ae48e6f56fdcfee3e9f50756ac620 /common/stringhelp.c
parentRemove an unused variable. (diff)
downloadgnupg-c071be698efadef1ad01fd3d329d1b486a372927.tar.gz
gnupg-c071be698efadef1ad01fd3d329d1b486a372927.zip
gpg: Lowercase mailbox for PKA lookups.
* common/stringhelp.c (ascii_strlwr): New. * common/mbox-util.c (mailbox_from_userid): Downcase result. -- Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/stringhelp.c')
-rw-r--r--common/stringhelp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/stringhelp.c b/common/stringhelp.c
index 7128de5fc..42e1bcbbb 100644
--- a/common/stringhelp.c
+++ b/common/stringhelp.c
@@ -804,6 +804,18 @@ ascii_tolower (int c)
return c;
}
+/* Lowercase all ASCII characters in S. */
+char *
+ascii_strlwr (char *s)
+{
+ char *p = s;
+
+ for (p=s; *p; p++ )
+ if (isascii (*p) && *p >= 'A' && *p <= 'Z')
+ *p |= 0x20;
+
+ return s;
+}
int
ascii_strcasecmp( const char *a, const char *b )