[PATCH] D102402: LineEditor: Add a bare-bones readline-based implementation

Adrian McCarthy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 13 11:19:16 PDT 2021


amccarth added a comment.

When this gets further along, maybe we can get LLDB to use it instead of EditLine.



================
Comment at: llvm/lib/LineEditor/LineEditor.cpp:30
+                                          FILE *Out) {
+  ::fprintf(Out, "%s", Prompt.c_str());
+
----------------
Nit:  In theory, this should be followed with a flush of Out.

In practice, it won't matter in most cases because stdio will ensure flushing stdout before accepting input on stdin.  But there's no guarantee here that In and Out correspond to the standard streams.  And since the prompt probably doesn't end with `'\n'`, you cannot count on that flushing either.


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

https://reviews.llvm.org/D102402



More information about the llvm-commits mailing list