From e431daf013ea04cb1a988a2009d820224ef5fb79 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Mon, 8 Oct 2018 23:54:01 +0200 Subject: curl: add %{stderr} and %{stdout} for --write-out Closes #3115 --- src/tool_writeout.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/tool_writeout.c') diff --git a/src/tool_writeout.c b/src/tool_writeout.c index ffe47c633..d394411b0 100644 --- a/src/tool_writeout.c +++ b/src/tool_writeout.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -60,6 +60,8 @@ typedef enum { VAR_LOCAL_PORT, VAR_HTTP_VERSION, VAR_SCHEME, + VAR_STDOUT, + VAR_STDERR, VAR_NUM_OF_VARS /* must be the last */ } replaceid; @@ -101,6 +103,8 @@ static const struct variable replacements[]={ {"local_port", VAR_LOCAL_PORT}, {"http_version", VAR_HTTP_VERSION}, {"scheme", VAR_SCHEME}, + {"stdout", VAR_STDOUT}, + {"stderr", VAR_STDERR}, {NULL, VAR_NONE} }; @@ -320,6 +324,12 @@ void ourWriteOut(CURL *curl, struct OutStruct *outs, const char *writeinfo) curl_easy_getinfo(curl, CURLINFO_SCHEME, &stringp)) fprintf(stream, "%s", stringp); + /* FALLTHROUGH */ + case VAR_STDOUT: + stream = stdout; + break; + case VAR_STDERR: + stream = stderr; break; default: break; -- cgit v1.2.3