| 276 | } |
| 277 | |
| 278 | void KDevelop::normalizeLineEndings(QByteArray& text) |
| 279 | { |
| 280 | for (int i = 0, s = text.size(); i < s; ++i) { |
| 281 | if (text[i] != '\r') { |
| 282 | continue; |
| 283 | } |
| 284 | if (i + 1 < s && text[i + 1] == '\n') { |
| 285 | text.remove(i, 1); |
| 286 | s -= 1; |
| 287 | } else { |
| 288 | text[i] = '\n'; |
| 289 | } |
| 290 | } |
| 291 | } |