From ee8d1a9e6c09b3ecc4b46f47b79358f78d458916 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 8 Feb 2019 09:32:55 +0100 Subject: common: New functions get_option_value and ascii_strupr. * common/server-help.c (get_option_value): New. * common/stringhelp.c (ascii_strupr): New. -- Signed-off-by: Werner Koch (cherry picked from commit e2f18023b3b3b7e55b35218f65e37448d1011172) This might come handy when we eventually backport other changes. --- common/stringhelp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'common/stringhelp.c') diff --git a/common/stringhelp.c b/common/stringhelp.c index 0abac8ae5..68fe99796 100644 --- a/common/stringhelp.c +++ b/common/stringhelp.c @@ -810,6 +810,19 @@ ascii_strlwr (char *s) return s; } +/* Upcase all ASCII characters in S. */ +char * +ascii_strupr (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 ) { -- cgit v1.2.3