mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-26 01:21:57 +00:00
Remove last CR.
This commit is contained in:
parent
490f52205f
commit
5b6945d909
@ -52,6 +52,10 @@ std::string Trim(std::string s) {
|
||||
TrimInPlace(s);
|
||||
return s;
|
||||
}
|
||||
void RemoveLastCR(std::string& s) {
|
||||
if (!s.empty() && *s.rbegin() == '\r')
|
||||
s.pop_back();
|
||||
}
|
||||
|
||||
uint64_t HashUsr(const std::string& s) {
|
||||
return HashUsr(s.c_str(), s.size());
|
||||
@ -334,6 +338,8 @@ std::vector<std::string> ToLines(const std::string& content,
|
||||
while (getline(lines, line)) {
|
||||
if (trim_whitespace)
|
||||
TrimInPlace(line);
|
||||
else
|
||||
RemoveLastCR(line);
|
||||
result.push_back(line);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user