| 150 | |
| 151 | #if defined(__linux) |
| 152 | static Slice TrimSpace(Slice s) { |
| 153 | size_t start = 0; |
| 154 | while (start < s.size() && isspace(s[start])) { |
| 155 | start++; |
| 156 | } |
| 157 | size_t limit = s.size(); |
| 158 | while (limit > start && isspace(s[limit - 1])) { |
| 159 | limit--; |
| 160 | } |
| 161 | return Slice(s.data() + start, limit - start); |
| 162 | } |
| 163 | #endif |
| 164 | |
| 165 | static void AppendWithSpace(std::string* str, Slice msg) { |
no test coverage detected