author | Pierre Habouzit <madcoder@debian.org> | |
Mon, 17 Sep 2007 09:19:04 +0000 (11:19 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 18 Sep 2007 07:55:10 +0000 (00:55 -0700) | ||
commit | e6c019d0b0140fae1cdfd661746cbe319b6c3670 | |
tree | 5711e59da3bda8207a41173df8d6a6b66696b7b5 | tree | snapshot |
parent | 8b6087fb25068d6af927f112a93dc056930f3108 | commit | diff |
Drop strbuf's 'eof' marker, and make read_line a first class citizen.
read_line is now strbuf_getline, and is a first class citizen, it returns 0
when reading a line worked, EOF else.
The ->eof marker was used non-locally by fast-import.c, mimic the same
behaviour using a static int in "read_next_command", that now returns -1 on
EOF, and avoids to call strbuf_getline when it's in EOF state.
Also no longer automagically strbuf_release the buffer, it's counter
intuitive and breaks fast-import in a very subtle way.
Note: being at EOF implies that command_buf.len == 0.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read_line is now strbuf_getline, and is a first class citizen, it returns 0
when reading a line worked, EOF else.
The ->eof marker was used non-locally by fast-import.c, mimic the same
behaviour using a static int in "read_next_command", that now returns -1 on
EOF, and avoids to call strbuf_getline when it's in EOF state.
Also no longer automagically strbuf_release the buffer, it's counter
intuitive and breaks fast-import in a very subtle way.
Note: being at EOF implies that command_buf.len == 0.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-checkout-index.c | diff | blob | history | |
builtin-update-index.c | diff | blob | history | |
fast-import.c | diff | blob | history | |
fetch.c | diff | blob | history | |
mktree.c | diff | blob | history | |
strbuf.c | diff | blob | history | |
strbuf.h | diff | blob | history |