diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-15 15:47:48 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-15 17:00:40 +0300 |
commit | 1d067868c05cc3b8b8b76f6d21ef4a3eebdc885c (patch) | |
tree | 41279d3fdb8b1da22b3336981d4314ded90ebf9d /source/blender/blenlib/intern/string.c | |
parent | 913b8396d971f258df70827274bcdf86dd894185 (diff) |
UI: tweak drawing of header status text for transparent headers.
Diffstat (limited to 'source/blender/blenlib/intern/string.c')
-rw-r--r-- | source/blender/blenlib/intern/string.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index c1696a912ba..f46676ac0cd 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -779,6 +779,21 @@ void BLI_str_toupper_ascii(char *str, const size_t len) } /** + * Strip whitespace from end of the string. + */ +void BLI_str_rstrip(char *str) +{ + for (int i = strlen(str) - 1; i > 0; i--) { + if (isspace(str[i])) { + str[i] = '\0'; + } + else { + break; + } + } +} + +/** * Strip trailing zeros from a float, eg: * 0.0000 -> 0.0 * 2.0010 -> 2.001 |