summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-07-25 16:17:48 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-07-25 16:34:18 -0400
commite28973ee182434b59ff562c9b22823250c9fdb4c (patch)
treed4e147d1cab24575b3e5ce13d1571063b4da56c5 /src/basic
parent1a0b98c43797ce96e47b110a58f0b4c55f3256f5 (diff)
parent7ba25ab5616339a8340117b85cbecd061c52d8cc (diff)
Merge pull request #3757 from poettering/efi-search
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/string-util.c19
-rw-r--r--src/basic/string-util.h3
2 files changed, 22 insertions, 0 deletions
diff --git a/src/basic/string-util.c b/src/basic/string-util.c
index 293a15f9c0..e9856b90d3 100644
--- a/src/basic/string-util.c
+++ b/src/basic/string-util.c
@@ -323,6 +323,14 @@ char ascii_tolower(char x) {
return x;
}
+char ascii_toupper(char x) {
+
+ if (x >= 'a' && x <= 'z')
+ return x - 'a' + 'A';
+
+ return x;
+}
+
char *ascii_strlower(char *t) {
char *p;
@@ -334,6 +342,17 @@ char *ascii_strlower(char *t) {
return t;
}
+char *ascii_strupper(char *t) {
+ char *p;
+
+ assert(t);
+
+ for (p = t; *p; p++)
+ *p = ascii_toupper(*p);
+
+ return t;
+}
+
char *ascii_strlower_n(char *t, size_t n) {
size_t i;
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index 1209e1e2e1..b75aba63c2 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -137,6 +137,9 @@ char ascii_tolower(char x);
char *ascii_strlower(char *s);
char *ascii_strlower_n(char *s, size_t n);
+char ascii_toupper(char x);
+char *ascii_strupper(char *s);
+
int ascii_strcasecmp_n(const char *a, const char *b, size_t n);
int ascii_strcasecmp_nn(const char *a, size_t n, const char *b, size_t m);