diff options
author | John Wiegley <johnw@newartisans.com> | 2015-01-20 15:40:40 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2015-01-20 15:40:40 -0600 |
commit | 7690a1b587945899f6a6a9255c0346b067dbf3b1 (patch) | |
tree | 7e11da7cee1bfc35f82b7c966f62ec4e840bcf81 /src | |
parent | 4ec3c9382918bce74fed02c1a5d001c0b8553140 (diff) | |
parent | 17189b81062b78baf4da1cf1ee494dc66bf1f736 (diff) | |
download | fork-ledger-7690a1b587945899f6a6a9255c0346b067dbf3b1.tar.gz fork-ledger-7690a1b587945899f6a6a9255c0346b067dbf3b1.tar.bz2 fork-ledger-7690a1b587945899f6a6a9255c0346b067dbf3b1.zip |
Merge pull request #379 from afh/pull/trim
[fix] Make trim function trim trailing whitespace
Diffstat (limited to 'src')
-rw-r--r-- | src/report.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/report.cc b/src/report.cc index 4b240611..2ce70151 100644 --- a/src/report.cc +++ b/src/report.cc @@ -631,7 +631,7 @@ value_t report_t::fn_trim(call_scope_t& args) while (*p && std::isspace(*p)) p++; - const char * e = buf.get() + temp.length(); + const char * e = buf.get() + temp.length() - 1; while (e > p && std::isspace(*e)) e--; @@ -643,7 +643,7 @@ value_t report_t::fn_trim(call_scope_t& args) return string_value(empty_string); } else { - return string_value(string(p, static_cast<std::string::size_type>(e - p))); + return string_value(string(p, static_cast<std::string::size_type>(e - p + 1))); } } |