From 8fade740267380cb690d4ac5c1f5688b21540beb Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 21 Sep 2013 11:21:21 -0700 Subject: [PATCH] Actually trim whitespace when combining lines regex_replace does not mutate the string in place. --- aegisub/src/command/edit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aegisub/src/command/edit.cpp b/aegisub/src/command/edit.cpp index 8bbe7e0de..fe1b5d8b4 100644 --- a/aegisub/src/command/edit.cpp +++ b/aegisub/src/command/edit.cpp @@ -863,8 +863,8 @@ std::string trim_text(std::string text) { boost::regex start("^( |\t|\\\\[nNh])+"); boost::regex end("( |\t|\\\\[nNh])+$"); - regex_replace(text, start, "", boost::format_first_only); - regex_replace(text, end, "", boost::format_first_only); + text = regex_replace(text, start, "", boost::format_first_only); + text = regex_replace(text, end, "", boost::format_first_only); return text; }