mirror of
https://github.com/transmission/transmission
synced 2024-12-23 08:13:27 +00:00
Fix off-by-one mistake in gtr_str_strip()
(#2057)
Was always trimming last non-whitespace char from the input text. Fixes: #2027
This commit is contained in:
parent
1d0993c3a5
commit
5da0a5d59b
1 changed files with 1 additions and 1 deletions
|
@ -154,7 +154,7 @@ inline T gtr_str_strip(T const& text)
|
|||
{
|
||||
auto const new_begin = text.find_first_not_of("\t\n\v\f\r ");
|
||||
auto const new_end = text.find_last_not_of("\t\n\v\f\r ");
|
||||
return new_begin == T::npos ? T() : text.substr(new_begin, new_end == T::npos ? new_end : new_end - new_begin);
|
||||
return new_begin == T::npos ? T() : text.substr(new_begin, new_end == T::npos ? new_end : new_end - new_begin + 1);
|
||||
}
|
||||
|
||||
namespace gtr_detail
|
||||
|
|
Loading…
Reference in a new issue