Replacing strbuf_getline_lf() by strbuf_getline() in wt-status.c

2 messages, 1 author, 2016-06-15 · open the first message on its own page

Replacing strbuf_getline_lf() by strbuf_getline() in wt-status.c

From: Moritz Neeb <hidden>
Date: 2016-06-15 23:08:02

Currently I am working on replacing strbuf_getline_lf() by
strbuf_getline() in places where the input is trimmed immediately after
reading, cf. $gmane/284104, "Notes on the remaining strbuf_getline_lf()
callers", 2nd point.

One instance I found was in wt-status.c. In read_rebase_todolist() the
lines are read, checked for a comment_line_char and then trimmed. I
wonder why the input is not trimmed before checking for this character?
Is it safe to replace strbuf_getline_lf() by strbuf_getline() anyway?

The only case I can imagine that could lead to unexpected behaviour then
would be when someone sets the comment_line_char to CR. How likely is that?

Why is the trim after checking for the comment char anyway? Should
something like "   # foobar" not be considered as comment?

Re: Replacing strbuf_getline_lf() by strbuf_getline() in wt-status.c

From: Moritz Neeb <hidden>
Date: 2016-06-15 23:08:02

On 01/30/2016 03:30 PM, Moritz Neeb wrote:
Currently I am working on replacing strbuf_getline_lf() by
strbuf_getline() in places where the input is trimmed immediately after
reading, cf. $gmane/284104, "Notes on the remaining strbuf_getline_lf()
callers", 2nd point.
This thread turned obsolete, as I decided to post a patch to focus the
discussion a bit more:

    http://thread.gmane.org/gmane.comp.version-control.git/285118

-Moritz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help