Merge tag 'kvm-s390-master-5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / tools / bootconfig / include / linux / string.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _SKC_LINUX_STRING_H
3 #define _SKC_LINUX_STRING_H
4
5 #include <string.h>
6
7 /* Copied from lib/string.c */
8 static inline char *skip_spaces(const char *str)
9 {
10         while (isspace(*str))
11                 ++str;
12         return (char *)str;
13 }
14
15 static inline char *strim(char *s)
16 {
17         size_t size;
18         char *end;
19
20         size = strlen(s);
21         if (!size)
22                 return s;
23
24         end = s + size - 1;
25         while (end >= s && isspace(*end))
26                 end--;
27         *(end + 1) = '\0';
28
29         return skip_spaces(s);
30 }
31
32 #endif