summaryrefslogtreecommitdiff
path: root/gtk2_ardour/save_template_dialog.cc
diff options
context:
space:
mode:
authorJohannes Mueller <github@johannes-mueller.org>2017-08-20 19:53:42 +0200
committerRobin Gareus <robin@gareus.org>2017-08-20 21:09:30 +0200
commit258fa81d90bd03775d3db92275d35baf9cff62be (patch)
tree3ca7e58a9e88c4b936b2d6d6c3442cba6e176efb /gtk2_ardour/save_template_dialog.cc
parent70addf1ed0a5914bef519fc50da7a9429ed18c7e (diff)
Strip trailing whitespace in template descriptions
Diffstat (limited to 'gtk2_ardour/save_template_dialog.cc')
-rw-r--r--gtk2_ardour/save_template_dialog.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk2_ardour/save_template_dialog.cc b/gtk2_ardour/save_template_dialog.cc
index 5d23006926..e4d3f6cbeb 100644
--- a/gtk2_ardour/save_template_dialog.cc
+++ b/gtk2_ardour/save_template_dialog.cc
@@ -68,5 +68,11 @@ SaveTemplateDialog::get_template_name () const
std::string
SaveTemplateDialog::get_description () const
{
- return _description_editor.get_buffer()->get_text();
+ std::string desc_txt = _description_editor.get_buffer()->get_text ();
+ std::string::reverse_iterator wss = desc_txt.rbegin();
+ while (wss != desc_txt.rend() && isspace (*wss)) {
+ desc_txt.erase (--(wss++).base());
+ }
+
+ return desc_txt;
}