]> asedeno.scripts.mit.edu Git - git.git/blobdiff - mktree.c
Drop strbuf's 'eof' marker, and make read_line a first class citizen.
[git.git] / mktree.c
index 3891cd9fb31bf9aa84a339a70c474c38569affa5..9c137dec4599c97d2827abda68692dc714f2d295 100644 (file)
--- a/mktree.c
+++ b/mktree.c
@@ -4,7 +4,6 @@
  * Copyright (c) Junio C Hamano, 2006
  */
 #include "cache.h"
-#include "strbuf.h"
 #include "quote.h"
 #include "tree.h"
 
@@ -89,8 +88,7 @@ int main(int ac, char **av)
                enum object_type type;
                char *path;
 
-               read_line(&sb, stdin, line_termination);
-               if (sb.eof)
+               if (strbuf_getline(&sb, stdin, line_termination) == EOF)
                        break;
                ptr = sb.buf;
                /* Input is non-recursive ls-tree output format
@@ -122,6 +120,7 @@ int main(int ac, char **av)
                if (path != ntr)
                        free(path);
        }
+       strbuf_release(&sb);
        write_tree(sha1);
        puts(sha1_to_hex(sha1));
        exit(0);