summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c8f373a)
raw | patch | inline | side by side (parent: c8f373a)
author | Brandon Casey <drafnel@gmail.com> | |
Wed, 5 Aug 2009 03:31:58 +0000 (22:31 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Aug 2009 19:13:58 +0000 (12:13 -0700) |
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-mailsplit.c | patch | blob | history | |
builtin.h | patch | blob | history |
diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c
index c2ec6ea3d51e760581dcb6f86c1783a545ebc07a..d288fde2c2cef606a60507a7a56b81352ab5d06e 100644 (file)
--- a/builtin-mailsplit.c
+++ b/builtin-mailsplit.c
static struct strbuf buf = STRBUF_INIT;
-/* We cannot use fgets() because our lines can contain NULs */
-int read_line_with_nul(char *buf, int size, FILE *in)
-{
- int len = 0, c;
-
- for (;;) {
- c = getc(in);
- if (c == EOF)
- break;
- buf[len++] = c;
- if (c == '\n' || len + 1 >= size)
- break;
- }
- buf[len] = '\0';
-
- return len;
-}
-
/* Called with the first line (potentially partial)
* already in buf[] -- normally that should begin with
* the Unix "From " line. Write it into the specified
diff --git a/builtin.h b/builtin.h
index 20427d2963fa25c1177bd05ab9f8be2890b9f7ba..9993dfcf99f7ad47a1a0a052d591cfc06a9f614d 100644 (file)
--- a/builtin.h
+++ b/builtin.h
extern void list_common_cmds_help(void);
extern const char *help_unknown_cmd(const char *cmd);
extern void prune_packed_objects(int);
-extern int read_line_with_nul(char *buf, int size, FILE *file);
extern int fmt_merge_msg(int merge_summary, struct strbuf *in,
struct strbuf *out);
extern int commit_tree(const char *msg, unsigned char *tree,