diff options
| author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2018-02-04 15:33:34 -0500 |
|---|---|---|
| committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2018-02-04 15:33:34 -0500 |
| commit | d9be1028d47cb7e98b474df420858a690798810b (patch) | |
| tree | fb37f83ca098129a5301ef141dc6a5007a0972a9 /util/string-util.c | |
| parent | a8fb877ad7e960d69ec10887ff79e24bb99c587c (diff) | |
| parent | 3c4e64d976eb561ac5157df1bbe5882e3e65b583 (diff) | |
Merge tag 'debian/0.26-1' into debian/stretch-backports
notmuch Debian 0.26-1 upload (same as 0.26)
Diffstat (limited to 'util/string-util.c')
| -rw-r--r-- | util/string-util.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/util/string-util.c b/util/string-util.c index 18125309..b0108811 100644 --- a/util/string-util.c +++ b/util/string-util.c @@ -255,3 +255,16 @@ strcase_hash (const void *ptr) return hash; } + +void +strip_trailing (char *str, char ch) +{ + int i; + + for (i = strlen (str) - 1; i >= 0; i--) { + if (str[i] == ch) + str[i] = '\0'; + else + break; + } +} |
