From 1774dbd74c77cd6c728588c8a717903dd16003f3 Mon Sep 17 00:00:00 2001 From: Emil Engler Date: Tue, 21 Jan 2020 09:23:21 +0100 Subject: curl: Let -D merge headers in one file again Closes #4762 Fixes #4753 --- src/tool_operate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tool_operate.c b/src/tool_operate.c index 66f2139c8..2e6563a20 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -871,7 +871,8 @@ static CURLcode single_transfer(struct GlobalConfig *global, if(config->headerfile) { /* open file for output: */ if(strcmp(config->headerfile, "-")) { - FILE *newfile = fopen(config->headerfile, "wb"); + FILE *newfile; + newfile = fopen(config->headerfile, per->prev == NULL?"wb":"ab"); if(!newfile) { warnf(config->global, "Failed to open %s\n", config->headerfile); result = CURLE_WRITE_ERROR; -- cgit v1.2.3