MCPcopy Create free account
hub / github.com/git/git / strbuf_getwholeline_fd

Function strbuf_getwholeline_fd

strbuf.c:762–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

760}
761
762int strbuf_getwholeline_fd(struct strbuf *sb, int fd, int term)
763{
764 strbuf_reset(sb);
765
766 while (1) {
767 char ch;
768 ssize_t len = xread(fd, &ch, 1);
769 if (len <= 0)
770 return EOF;
771 strbuf_addch(sb, ch);
772 if (ch == term)
773 break;
774 }
775 return 0;
776}
777
778ssize_t strbuf_read_file(struct strbuf *sb, const char *path, size_t hint)
779{

Callers 3

append_merge_parentsFunction · 0.85
read_bundle_header_fdFunction · 0.85

Calls 2

xreadFunction · 0.85
strbuf_addchFunction · 0.85

Tested by

no test coverage detected