summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f6b6098)
raw | patch | inline | side by side (parent: f6b6098)
author | Thomas Rast <trast@student.ethz.ch> | |
Fri, 11 Jun 2010 15:02:50 +0000 (17:02 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 11 Jun 2010 20:46:25 +0000 (13:46 -0700) |
ebaa79f (Make report() from usage.c public as vreportf() and use it.,
2010-03-06) changed fast-import's die_nicely() to use vreportf().
Unfortunately this is not possible: we need the message again for
write_report(), and vreportf() uses vsnprintf(), which invalidates the
va_list. As pointed out by Erik Faye-Lund, va_copy is C99 and thus
not an option.
So revert the part of ebaa79f that pertains to die_nicely().
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-06) changed fast-import's die_nicely() to use vreportf().
Unfortunately this is not possible: we need the message again for
write_report(), and vreportf() uses vsnprintf(), which invalidates the
va_list. As pointed out by Erik Faye-Lund, va_copy is C99 and thus
not an option.
So revert the part of ebaa79f that pertains to die_nicely().
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fast-import.c | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index f2ef20cbf03bbf5c34958cbeb876fba3891b1f42..309f2c58a2ba431a82a56f757482a5093cc8257d 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
static NORETURN void die_nicely(const char *err, va_list params)
{
static int zombie;
+ char message[2 * PATH_MAX];
- vreportf("fatal: ", err, params);
+ vsnprintf(message, sizeof(message), err, params);
+ fputs("fatal: ", stderr);
+ fputs(message, stderr);
+ fputc('\n', stderr);
if (!zombie) {
- char message[2 * PATH_MAX];
-
zombie = 1;
write_crash_report(message);
end_packfile();