summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e0ab002)
raw | patch | inline | side by side (parent: e0ab002)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 29 Sep 2009 06:40:08 +0000 (23:40 -0700) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 29 Sep 2009 16:40:55 +0000 (09:40 -0700) |
A recent "cut at scissors" implementation rewinds and truncates
the output file to store the message when it sees a scissors mark,
but it did not check if these library calls succeeded.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
[sp: Use fseek as rewind returns void]
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
the output file to store the message when it sees a scissors mark,
but it did not check if these library calls succeeded.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
[sp: Use fseek as rewind returns void]
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
builtin-mailinfo.c | patch | blob | history |
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index d498b1cd2d9a2a99bd9564615dfe9bc98ecca47f..c90cd312ac99fe9a2169664e86a089b5378cacbe 100644 (file)
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
if (use_scissors && is_scissors_line(line)) {
int i;
- rewind(cmitmsg);
- ftruncate(fileno(cmitmsg), 0);
+ if (fseek(cmitmsg, 0L, SEEK_SET))
+ die_errno("Could not rewind output message file");
+ if (ftruncate(fileno(cmitmsg), 0))
+ die_errno("Could not truncate output message file at scissors");
still_looking = 1;
/*