diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-08-22 10:29:15 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-22 10:29:15 -0700 |
commit | 0c493966ff6af8d2217aaa40dd6f7916bd992b0a (patch) | |
tree | 1774f32283a00734ac2739d0343dc7bf4c37bc5d /strbuf.c | |
parent | e2a2a1daacb43d8296baf155ae6ea0ec6e2f2b8d (diff) | |
parent | 642956cf455ff8635be32b3160b12369da73cfe2 (diff) | |
download | git-0c493966ff6af8d2217aaa40dd6f7916bd992b0a.tar.gz |
Merge branch 'rs/strbuf-getwholeline-fix'
A helper function to read a single whole line into strbuf
mistakenly triggered OOM error at EOF under certain conditions,
which has been fixed.
* rs/strbuf-getwholeline-fix:
strbuf: clear errno before calling getdelim(3)
Diffstat (limited to 'strbuf.c')
-rw-r--r-- | strbuf.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -476,6 +476,7 @@ int strbuf_getwholeline(struct strbuf *sb, FILE *fp, int term) /* Translate slopbuf to NULL, as we cannot call realloc on it */ if (!sb->alloc) sb->buf = NULL; + errno = 0; r = getdelim(&sb->buf, &sb->alloc, term, fp); if (r > 0) { |