[Lldb-commits] [PATCH] D70177: [lldb] Fix that trailing backslashes in source lines break the Clang highlighter

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 13 06:44:25 PST 2019


labath added inline comments.


================
Comment at: lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp:150
+  const bool line_had_lf = line.endswith("\n") && !line_had_cr_lf;
+  line = line.trim("\r\n");
+
----------------
technically, this `trim` might remove additional spurious carriage return characters that will not be restored correctly afterwards. What I'd do is replace `endswith` with `consume_back` which will also remove the suffix while testing for it's presence.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70177/new/

https://reviews.llvm.org/D70177





More information about the lldb-commits mailing list