summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/FacebookRM/src/utils.cpp')
-rw-r--r--protocols/FacebookRM/src/utils.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/protocols/FacebookRM/src/utils.cpp b/protocols/FacebookRM/src/utils.cpp
index 10214d970c..44de994a73 100644
--- a/protocols/FacebookRM/src/utils.cpp
+++ b/protocols/FacebookRM/src/utils.cpp
@@ -351,13 +351,13 @@ std::string utils::text::slashu_to_utf8(std::string data)
return new_string;
}
-std::string utils::text::trim(std::string data)
+std::string utils::text::trim(std::string data, bool rtrim)
{
std::string spaces = " \t\r\n"; // TODO: include "nbsp"?
- std::string::size_type begin = data.find_first_not_of(spaces);
+ std::string::size_type begin = rtrim ? 0 : data.find_first_not_of(spaces);
std::string::size_type end = data.find_last_not_of(spaces) + 1;
- return (begin != std::string::npos) ? data.substr(begin, end - begin) : "";
+ return (end != std::string::npos) ? data.substr(begin, end - begin) : "";
}
void utils::text::explode(std::string str, std::string separator, std::vector<std::string>* results)