w3mail

program to send a web page by email
git clone https://logand.com/git/w3mail.git/
Log | Files | Refs | README | LICENSE

commit 8b5da9306a8a2be2449315b80dd43d4bf0ea21f5
parent 729199ea313b92b560483c4cf45f12de56abf15a
Author: Tomas Hlavaty <tom@logand.com>
Date:   Thu, 13 Jan 2011 22:23:09 +0100

all wget in one function

Diffstat:
Mw3mail.c | 25++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/w3mail.c b/w3mail.c @@ -77,20 +77,19 @@ static void fpr(FILE *out, ...) { va_end(v); } -// http://www.gnu.org/software/wget/manual/html_node/Exit-Status.html -static char *wgetmsg[] = { - "No problems occurred", - "Generic error code", - "Parse error, e.g. when parsing command-line options, .wgetrc or .netrc", - "File I/O error", - "Network failure", - "SSL verification failure", - "Username/password authentication failure", - "Protocol errors", - "Server issued an error response" -}; - static void wget(char *url, char *fname) { + // http://www.gnu.org/software/wget/manual/html_node/Exit-Status.html + static char *wgetmsg[] = { + "No problems occurred", + "Generic error code", + "Parse error, e.g. when parsing command-line options, .wgetrc or .netrc", + "File I/O error", + "Network failure", + "SSL verification failure", + "Username/password authentication failure", + "Protocol errors", + "Server issued an error response" + }; int pid = fork(); if(pid < 0) die(pid, "wget(): fork failed"); else if(pid == 0) execlp("wget", "wget", "-q", "-O", fname, "--", url, NULL);