--- /dev/null
+src/wget.h
--- /dev/null
+doc/wget.texi
+po/bg.po
+ChangeLog
+doc/ChangeLog
+src/ChangeLog
+windows/ChangeLog
+msdos/ChangeLog
+tests/ChangeLog
+build-aux/texinfo.tex
2009-09-21 Micah Cowan <micah@cowan.name>
+ * vms/VMS-WGET.COM: "the the" -> "the".
+
+ * po/POTFILES.in: Removed some files that are not using gettext.
+
* po/*.po: Updated from translationproject.org.
2009-09-20 Micah Cowan <micah@cowan.name>
./ChangeLog: documents changes to files in the top-level directory
and to files in subdirectories like po/ that don't have
- their own ChangeLogs
+ their own ChangeLogs
src/ChangeLog: documents only changes to files in the src directory
** --ask-password option (and associated wgetrc command) added to
support password prompts at the console.
-
+
** The --input-file option now also handles retrieving links from
an external file.
** A number of new translation files have been added.
-** New --bind-address / bind_address = <address> option for people on hosts
+** New --bind-address / bind_address = <address> option for people on hosts
bound to multiple IP addresses.
** wget now accepts (illegal per HTTP spec) relative URLs in HTTP redirects.
+export VC_LIST_EXCEPT_DEFAULT=^(lib/.*|m4/.*|md5/.*|build-aux/.*|src/gettext\.h|.*ChangeLog)$$
+local-checks-to-skip = \
+ sc_const_long_option \
+ sc_error_message_uppercase \
+ sc_file_system \
+ sc_makefile_TAB_only_indentation \
+ sc_immutable_NEWS \
+ sc_copyright_check \
+ sc_makefile_path_separator_check \
+ sc_require_config_h \
+ sc_require_config_h_first \
+ sc_two_space_separator_in_usage \
+ sc_useless_cpp_parens \
+ \
+ sc_space_tab \
+ sc_prohibit_atoi_atof \
+ sc_prohibit_strcmp \
+ sc_makefile_check \
+ sc_cast_of_alloca_return_value \
+ sc_cast_of_x_alloc_return_value \
+ sc_prohibit_S_IS_definition \
+ \
+ sc_program_name \
+
+
+#SHELL=bash -x
+show-vc-list-except:
+ @$(VC_LIST_EXCEPT)
dnl Process this file with autoconf to produce a configure script.
dnl
-AC_INIT([wget],
+AC_INIT([wget],
[1.12-devel],
[bug-wget@gnu.org])
AC_PREREQ(2.61)
fi
if test "X$iri" != "Xno" ; then
- AC_DEFINE(ENABLE_IRI, 1, [Define if IRI support is enabled.])
+ AC_DEFINE([ENABLE_IRI], 1, [Define if IRI support is enabled.])
AC_MSG_NOTICE([Enabling support for IRI.])
else
AC_MSG_WARN([Libidn not found])
## avoid having to type many many command-line options. This file does
## not contain a comprehensive list of commands -- look at the manual
## to find out what you can put into this file.
-##
+##
## Wget initialization file can reside in /usr/local/etc/wgetrc
## (global, for all users) or $HOME/.wgetrc (for a single user).
##
$file = postprocess($1);
# Try cwd and $ibase.
- open($inf, "<" . $file)
+ open($inf, "<" . $file)
or open($inf, "<" . $ibase . "/" . $file)
or die "cannot open $file or $ibase/$file: $!\n";
next;
AC_DEFUN([MEMBER_SIN6_SCOPE_ID],[
AC_REQUIRE([TYPE_STRUCT_SOCKADDR_IN6])
-
+
wget_member_sin6_scope_id=
if test "X$wget_have_sockaddr_in6" = "Xyes"; then
AC_CHECK_MEMBER([struct sockaddr_in6.sin6_scope_id],[
lib/getopt.c
lib/quotearg.c
lib/xalloc-die.c
-src/cmpt.c
src/connect.c
src/convert.c
src/cookies.c
-src/ftp-basic.c
src/ftp-ls.c
-src/ftp-opie.c
src/ftp.c
-src/gen-md5.c
src/gnutls.c
-src/hash.c
src/host.c
-src/html-parse.c
src/html-url.c
src/http.c
src/init.c
+2009-09-21 Micah Cowan <micah@cowan.name>
+
+ * progress.c (update_speed_ring): "the the" -> "the".
+
+ * css-url.c, iri.c, mswindows.c: Removed assert.h inclusion (not
+ using it).
+
2009-09-11 Steven Schweda <sms@antinode.info>
* utils.c, utils.h (fopen_excl): Make second argument an int,
/* In case of error, we will go on anyway... */
int err = setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof (on));
IF_DEBUG
- if (err < 0)
+ if (err < 0)
DEBUGP (("Failed setting IPV6_V6ONLY: %s", strerror (errno)));
}
#endif
However, our hash tables only accept pointers for keys and values.
So when we need a pointer, we use the address of a
downloaded_file_t variable of static storage. */
-
+
static downloaded_file_t *
downloaded_mode_to_ptr (downloaded_file_t mode)
{
if (!silent)
logprintf (LOG_NOTQUIET,
_("Syntax error in Set-Cookie: %s at position %d.\n"),
- quotearg_style (escape_quoting_style, set_cookie),
+ quotearg_style (escape_quoting_style, set_cookie),
(int) (ptr - set_cookie));
delete_cookie (cookie);
return NULL;
{
logprintf (LOG_NOTQUIET,
_("Cookie coming from %s attempted to set domain to %s\n"),
- quotearg_style (escape_quoting_style, host),
+ quotearg_style (escape_quoting_style, host),
quotearg_style (escape_quoting_style, cookie->domain));
xfree (cookie->domain);
goto copy_domain;
/* Support for sending out cookies in HTTP requests, based on
previously stored cookies. Entry point is
`build_cookies_request'. */
-
+
/* Return a count of how many times CHR occurs in STRING. */
static int
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
-#include <assert.h>
#include "wget.h"
#include "utils.h"
if (uri)
{
strncpy (uri, at + *pos, *length);
- uri[*length] = '\0';
+ uri[*length] = '\0';
}
return uri;
*--p = '\0';
if (opt.server_response)
- logprintf (LOG_NOTQUIET, "%s\n",
+ logprintf (LOG_NOTQUIET, "%s\n",
quotearg_style (escape_quoting_style, line));
else
DEBUGP (("%s\n", quotearg_style (escape_quoting_style, line)));
if (*p == '\r' || *p == '\n')
*p = ' ';
DEBUGP (("\nDetected newlines in %s \"%s\"; changing to %s \"%s\"\n",
- command, quotearg_style (escape_quoting_style, value),
+ command, quotearg_style (escape_quoting_style, value),
command, quotearg_style (escape_quoting_style, defanged)));
/* Make VALUE point to the defanged copy of the string. */
value = defanged;
}
static void
-ip_address_to_port_repr (const ip_address *addr, int port, char *buf,
+ip_address_to_port_repr (const ip_address *addr, int port, char *buf,
size_t buflen)
{
unsigned char *ptr;
#ifdef ENABLE_IPV6
static void
-ip_address_to_lprt_repr (const ip_address *addr, int port, char *buf,
+ip_address_to_lprt_repr (const ip_address *addr, int port, char *buf,
size_t buflen)
{
unsigned char *ptr = IP_INADDR_DATA (addr);
assert (buflen >= 21 * 4);
/* Construct the argument of LPRT (of the form af,n,h1,h2,...,hn,p1,p2). */
- switch (addr->family)
+ switch (addr->family)
{
- case AF_INET:
- snprintf (buf, buflen, "%d,%d,%d,%d,%d,%d,%d,%d,%d", 4, 4,
+ case AF_INET:
+ snprintf (buf, buflen, "%d,%d,%d,%d,%d,%d,%d,%d,%d", 4, 4,
ptr[0], ptr[1], ptr[2], ptr[3], 2,
(port & 0xff00) >> 8, port & 0xff);
break;
- case AF_INET6:
+ case AF_INET6:
snprintf (buf, buflen,
"%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
6, 16,
- ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7],
+ ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7],
ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13], ptr[14], ptr[15],
2, (port & 0xff00) >> 8, port & 0xff);
break;
}
static void
-ip_address_to_eprt_repr (const ip_address *addr, int port, char *buf,
+ip_address_to_eprt_repr (const ip_address *addr, int port, char *buf,
size_t buflen)
{
int afnum;
- /* buf must contain the argument of EPRT (of the form |af|addr|port|).
- * 4 chars for the | separators, INET6_ADDRSTRLEN chars for addr
+ /* buf must contain the argument of EPRT (of the form |af|addr|port|).
+ * 4 chars for the | separators, INET6_ADDRSTRLEN chars for addr
* 1 char for af (1-2) and 5 chars for port (0-65535) */
- assert (buflen >= 4 + INET6_ADDRSTRLEN + 1 + 5);
+ assert (buflen >= 4 + INET6_ADDRSTRLEN + 1 + 5);
/* Construct the argument of EPRT (of the form |af|addr|port|). */
afnum = (addr->family == AF_INET ? 1 : 2);
ip_address addr;
int nwritten;
int port;
- /* Must contain the argument of EPRT (of the form |af|addr|port|).
- * 4 chars for the | separators, INET6_ADDRSTRLEN chars for addr
+ /* Must contain the argument of EPRT (of the form |af|addr|port|).
+ * 4 chars for the | separators, INET6_ADDRSTRLEN chars for addr
* 1 char for af (1-2) and 5 chars for port (0-65535) */
char bytes[4 + INET6_ADDRSTRLEN + 1 + 5 + 1];
{
xfree (respline);
return FTPNOPASV;
- }
+ }
/* Parse the response. */
s = respline;
{
xfree (respline);
return FTPNOPASV;
- }
+ }
assert (respline != NULL);
{
xfree (respline);
return FTPINVPASV;
- }
+ }
/* Skip the first two void fields */
s = start + 1;
{
xfree (respline);
return FTPINVPASV;
- }
+ }
for (i = 0; i < 2; i++)
{
- if (*s++ != delim)
+ if (*s++ != delim)
{
xfree (respline);
return FTPINVPASV;
- }
+ }
}
/* Finally, get the port number */
- tport = 0;
- for (i = 1; c_isdigit (*s); s++)
+ tport = 0;
+ for (i = 1; c_isdigit (*s); s++)
{
if (i > 5)
{
xfree (respline);
return FTPINVPASV;
- }
+ }
tport = (*s - '0') + 10 * tport;
}
{
xfree (respline);
return FTPINVPASV;
- }
+ }
if (*s++ != ')')
{
xfree (respline);
return FTPINVPASV;
- }
+ }
*port = tport;
bool ok = false;
size_t i = 0;
/* Try `LIST -a' first and revert to `LIST' in case of failure. */
- const char *list_commands[] = { "LIST -a",
+ const char *list_commands[] = { "LIST -a",
"LIST" };
/* 2008-01-29 SMS. For a VMS FTP server, where "LIST -a" may not
err = FTPOK;
ok = true;
}
- else
+ else
{
err = FTPRERR;
}
}
++i;
} while (i < countof (list_commands) && !ok);
-
+
return err;
}
}
if (*respline == '5')
{
- /*
+ /*
* Probably means SIZE isn't supported on this server.
- * Error is nonfatal since SIZE isn't in RFC 959
+ * Error is nonfatal since SIZE isn't in RFC 959
*/
xfree (respline);
*size = 0;
*size = str_to_wgint (respline + 4, NULL, 10);
if (errno)
{
- /*
+ /*
* Couldn't parse the response for some reason. On the (few)
* tests I've done, the response is 213 <SIZE> with nothing else -
* maybe something a bit more resilient is necessary. It's not a
/* Parsing FTP `ls' output.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Wget.
clean_line(char *line)
{
int len = strlen (line);
- if (!len) return 0;
+ if (!len) return 0;
if (line[len - 1] == '\n')
line[--len] = '\0';
- if (!len) return 0;
+ if (!len) return 0;
if (line[len - 1] == '\r')
line[--len] = '\0';
- for ( ; *line ; line++ ) if (*line == '\t') *line = ' ';
+ for ( ; *line ; line++ ) if (*line == '\t') *line = ' ';
return len;
}
if (hour == 12) hour = 0;
if (*tok == 'P') hour += 12;
- DEBUGP(("YYYY/MM/DD HH:MM - %d/%02d/%02d %02d:%02d\n",
+ DEBUGP(("YYYY/MM/DD HH:MM - %d/%02d/%02d %02d:%02d\n",
year+1900, month, day, hour, min));
-
+
/* Build the time-stamp (copy & paste from above) */
timestruct.tm_sec = 0;
timestruct.tm_min = min;
more or less. (Different VMS FTP servers may have different headers,
and may not supply the same data, but all should be subsets of this.)
- VMS normally provides local (server) time and date information.
+ VMS normally provides local (server) time and date information.
Define the logical name or environment variable
"WGET_TIMEZONE_DIFFERENTIAL" (seconds) to adjust the receiving local
times if different from the remote local times.
#endif /* (!defined( __VMS) && !defined( PRESERVE_VMS_VERSIONS)) */
/* 2005-02-23 SMS.
- Eliminate "^" escape characters from ODS5 extended file name.
+ Eliminate "^" escape characters from ODS5 extended file name.
(A caret is invalid in an ODS2 name, so this is always safe.)
*/
eat_carets( tok);
*/
tok = strtok(NULL, " ");
- if (tok == NULL)
+ if (tok == NULL)
{
DEBUGP(("Getting additional line.\n"));
xfree (line);
}
else
{
- /* Nondescript. Probably size(s), probably in blocks.
+ /* Nondescript. Probably size(s), probably in blocks.
Could be "No privilege ..." message. (Ignore.)
*/
DEBUGP (("Ignored (size?).\n"));
int cmd; /* command code */
int csock; /* control connection socket */
double dltime; /* time of the download in msecs */
- enum stype rs; /* remote system reported by ftp server */
+ enum stype rs; /* remote system reported by ftp server */
char *id; /* initial directory */
char *target; /* target file name */
struct url *proxy; /* FTWK-style proxy */
}
#ifdef ENABLE_IPV6
-/*
+/*
* This function sets up a passive data connection with the FTP server.
* It is merely a wrapper around ftp_epsv, ftp_lpsv and ftp_pasv.
*/
if (!socket_ip_address (csock, addr, ENDPOINT_PEER))
abort ();
- /* If our control connection is over IPv6, then we first try EPSV and then
- * LPSV if the former is not supported. If the control connection is over
+ /* If our control connection is over IPv6, then we first try EPSV and then
+ * LPSV if the former is not supported. If the control connection is over
* IPv4, we simply issue the good old PASV request. */
switch (addr->family)
{
return err;
}
-/*
+/*
* This function sets up an active data connection with the FTP server.
* It is merely a wrapper around ftp_eprt, ftp_lprt and ftp_port.
*/
if (!socket_ip_address (csock, &cip, ENDPOINT_PEER))
abort ();
- /* If our control connection is over IPv6, then we first try EPRT and then
- * LPRT if the former is not supported. If the control connection is over
+ /* If our control connection is over IPv6, then we first try EPRT and then
+ * LPRT if the former is not supported. If the control connection is over
* IPv4, we simply issue the good old PORT request. */
switch (cip.family)
{
con->csock = -1;
/* Second: Login with proper USER/PASS sequence. */
- logprintf (LOG_VERBOSE, _("Logging in as %s ... "),
+ logprintf (LOG_VERBOSE, _("Logging in as %s ... "),
quotearg_style (escape_quoting_style, user));
if (opt.server_response)
logputs (LOG_ALWAYS, "\n");
*/
/* VMS will report something like "PUB$DEVICE:[INITIAL.FOLDER]".
- Convert it to "/INITIAL/FOLDER" */
+ Convert it to "/INITIAL/FOLDER" */
if (con->rs == ST_VMS)
{
char *path = strchr (con->id, '[');
Why is this wise even on UNIX? It certainly fouls VMS.
See below for a more reliable, more universal method.
*/
-
+
/* 2008-04-22 MJC.
I'm not crazy about it either. I'm informed it's useful
for misconfigured servers that have some dirs in the path
#endif /* 0 */
/* 2004-09-20 SMS.
- A relative directory is relative to the initial directory.
+ A relative directory is relative to the initial directory.
Thus, what _is_ useful on VMS (and probably elsewhere) is
to CWD to the initial directory (ideally, whatever the
server reports, _exactly_, NOT badly UNIX-ixed), and then
if (opt.verbose)
{
if (!opt.server_response)
- logprintf (LOG_VERBOSE, "==> SIZE %s ... ",
+ logprintf (LOG_VERBOSE, "==> SIZE %s ... ",
quotearg_style (escape_quoting_style, u->file));
}
} /* switch (err) */
if (err==FTPOK)
{
- DEBUGP (("trying to connect to %s port %d\n",
+ DEBUGP (("trying to connect to %s port %d\n",
print_address (&passive_addr), passive_port));
dtsock = connect_to_ip (&passive_addr, passive_port, NULL);
if (dtsock < 0)
uerr_t res;
struct fileinfo *f;
res = ftp_get_listing (u, con, &f);
- /* Set the DO_RETR command flag again, because it gets unset when
- calling ftp_get_listing() and would otherwise cause an assertion
- failure earlier on when this function gets repeatedly called
+ /* Set the DO_RETR command flag again, because it gets unset when
+ calling ftp_get_listing() and would otherwise cause an assertion
+ failure earlier on when this function gets repeatedly called
(e.g., when recursing). */
con->cmd |= DO_RETR;
if (res == RETROK)
{
- while (f)
+ while (f)
{
if (!strcmp (f->name, u->file))
{
{
if (restval)
logputs (LOG_VERBOSE, "\n");
- logprintf (LOG_VERBOSE, "==> RETR %s ... ",
+ logprintf (LOG_VERBOSE, "==> RETR %s ... ",
quotearg_style (escape_quoting_style, u->file));
}
}
}
/* Open the file -- if output_stream is set, use it instead. */
-
+
/* 2005-04-17 SMS.
Note that having the output_stream ("-O") file opened in main()
(main.c) rather limits the ability in VMS to open the file
con->target = targ;
}
#endif /* def __VMS */
-
+
mkalldirs (con->target);
if (opt.backups)
rotate_backups (con->target);
#else /* def __VMS */
# define BIN_TYPE_FILE 1
#endif /* def __VMS [else] */
-
+
if (restval && !(con->cmd & DO_LIST))
{
#ifdef __VMS
char *p = strchr (line, '\0');
while (p > line && (p[-1] == '\n' || p[-1] == '\r'))
*--p = '\0';
- logprintf (LOG_ALWAYS, "%s\n",
+ logprintf (LOG_ALWAYS, "%s\n",
quotearg_style (escape_quoting_style, line));
xfree (line);
}
if (matchres == -1)
{
logprintf (LOG_NOTQUIET, _("Error matching %s against %s: %s\n"),
- u->file, quotearg_style (escape_quoting_style, f->name),
+ u->file, quotearg_style (escape_quoting_style, f->name),
strerror (errno));
break;
}
};
bool
-ssl_connect (int fd)
+ssl_connect (int fd)
{
static const int cert_type_priority[] = {
GNUTLS_CRT_X509, GNUTLS_CRT_OPENPGP, 0
* Support for hash tables whose keys are strings.
*
*/
-
+
/* Base 31 hash function. Taken from Gnome's glib, modified to use
standard C types.
{
const char *p = key;
unsigned int h = *p;
-
+
if (h)
for (p += 1; *p != '\0'; p++)
h = (h << 5) - h + *p;
-
+
return h;
}
{
const char *p = key;
unsigned int h = c_tolower (*p);
-
+
if (h)
for (p += 1; *p != '\0'; p++)
h = (h << 5) - h + c_tolower (*p);
-
+
return h;
}
ip = al->addresses;
for (ptr = ai; ptr != NULL; ptr = ptr->ai_next)
- if (ptr->ai_family == AF_INET6)
+ if (ptr->ai_family == AF_INET6)
{
const struct sockaddr_in6 *sin6 =
(const struct sockaddr_in6 *)ptr->ai_addr;
ip->ipv6_scope = sin6->sin6_scope_id;
#endif
++ip;
- }
+ }
else if (ptr->ai_family == AF_INET)
{
const struct sockaddr_in *sin =
}
if (octets < 4)
return false;
-
+
return true;
}
if (str == end)
return false;
-
+
/* Leading :: requires some special handling. */
if (*str == ':')
{
saw_xdigit = false;
break;
}
-
+
return false;
}
if (saw_xdigit)
{
- if (tp > ns_in6addrsz - ns_int16sz)
+ if (tp > ns_in6addrsz - ns_int16sz)
return false;
tp += ns_int16sz;
}
if (colonp != NULL)
{
- if (tp == ns_in6addrsz)
+ if (tp == ns_in6addrsz)
return false;
tp = ns_in6addrsz;
}
/* Find the tag in our table of tags. This must not fail because
map_html_tags only returns tags found in interesting_tags.
-
+
I've changed this for now, I'm passing NULL as interesting_tags
to map_html_tags. This way we can check all tags for a style
attribute.
#include "wget.h"
/* NTLM details:
-
+
http://davenport.sourceforge.net/ntlm.html
http://www.innovation.ch/java/ntlm.html
if (len > 14)
len = 14;
-
+
for (i=0; i<len; i++)
pw[i] = c_toupper (password[i]);
setup_des_key(pw, DESKEY(ks));
DES_ecb_encrypt((DES_cblock *)magic, (DES_cblock *)lmbuffer,
DESKEY(ks), DES_ENCRYPT);
-
+
setup_des_key(pw+7, DESKEY(ks));
DES_ecb_encrypt((DES_cblock *)magic, (DES_cblock *)(lmbuffer+8),
DESKEY(ks), DES_ENCRYPT);
if(!passwd)
passwd="";
-
+
switch(ntlm->state) {
case NTLMSTATE_TYPE1:
default: /* for the weird cases we (re)start here */
domoff = hostoff + hostlen;
DEBUGP (("Creating a type-1 NTLM message.\n"));
-
+
/* Create and send a type-1 message:
Index Description Content
output = concat_strings ("NTLM ", base64, (char *) 0);
break;
-
+
case NTLMSTATE_TYPE2:
/* We received the type-2 already, create a type-3 message:
52 (64) start of data block
*/
-
+
{
int lmrespoff;
int ntrespoff;
"%c%c" /* domain allocated space */
"%c%c" /* domain name offset */
"%c%c" /* 2 zeroes */
-
+
"%c%c" /* user length */
"%c%c" /* user allocated space */
"%c%c" /* user offset */
"%c%c" /* 2 zeroes */
-
+
"%c%c" /* host length */
"%c%c" /* host allocated space */
"%c%c" /* host offset */
"%c%c%c%c%c%c" /* 6 zeroes */
-
+
"\xff\xff" /* message length */
"%c%c" /* 2 zeroes */
-
+
"\x01\x82" /* flags */
"%c%c" /* 2 zeroes */
before we copy them there. */
if(((size_t) size + userlen + domlen) >= sizeof(ntlmbuf))
return NULL;
-
+
memcpy(&ntlmbuf[size], domain, domlen);
size += domlen;
}
#ifdef USE_NTRESPONSES
- if(size < ((int)sizeof(ntlmbuf) - 0x18)) {
+ if(size < ((int)sizeof(ntlmbuf) - 0x18)) {
memcpy(&ntlmbuf[size], ntresp, 0x18);
size += 0x18;
}
while (p < end && c_isdigit (*p))
++p;
if (p < end && *p == '.')
- ++p;
+ ++p;
while (p < end && c_isdigit (*p))
++p;
}
{
char *copy;
BOUNDED_TO_ALLOCA(b, e, copy);
- logprintf (LOG_ALWAYS, "%s%s\n", prefix,
+ logprintf (LOG_ALWAYS, "%s%s\n", prefix,
quotearg_style (escape_quoting_style, copy));
}
bool add_slash = (opt.dir_prefix[prefix_length - 1] != '/');
int total_length;
- if (add_slash)
+ if (add_slash)
++prefix_length;
- total_length = prefix_length + (value.e - value.b);
+ total_length = prefix_length + (value.e - value.b);
*filename = xmalloc (total_length + 1);
strcpy (*filename, opt.dir_prefix);
- if (add_slash)
+ if (add_slash)
(*filename)[prefix_length - 1] = '/';
memcpy (*filename + prefix_length, value.b, (value.e - value.b));
(*filename)[total_length] = '\0';
existence after having begun to download
(needed in gethttp for when connection is
interrupted/restarted. */
- bool timestamp_checked; /* true if pre-download time-stamping checks
+ bool timestamp_checked; /* true if pre-download time-stamping checks
* have already been performed */
char *orig_file_name; /* name of file to compare for time-stamping
* (might be != local_file if -K is set) */
wgint orig_file_size; /* size of file to compare for time-stamping */
- time_t orig_file_tstamp; /* time-stamp of file to compare for
+ time_t orig_file_tstamp; /* time-stamp of file to compare for
* time-stamping */
};
sock = pconn.socket;
using_ssl = pconn.ssl;
logprintf (LOG_VERBOSE, _("Reusing existing connection to %s:%d.\n"),
- quotearg_style (escape_quoting_style, pconn.host),
+ quotearg_style (escape_quoting_style, pconn.host),
pconn.port);
DEBUGP (("Reusing fd %d.\n", sock));
if (pconn.authorized)
pconn.authorized = true;
}
- /* Determine the local filename if needed. Notice that if -O is used
+ /* Determine the local filename if needed. Notice that if -O is used
* hstat.local_file is set by http_loop to the argument of -O. */
if (!hs->local_file)
{
/* Honor Content-Disposition whether possible. */
if (!opt.content_disposition
- || !resp_header_copy (resp, "Content-Disposition",
+ || !resp_header_copy (resp, "Content-Disposition",
hdrval, sizeof (hdrval))
|| !parse_content_disposition (hdrval, &hs->local_file))
{
- /* The Content-Disposition header is missing or broken.
+ /* The Content-Disposition header is missing or broken.
* Choose unique file name according to given URL. */
hs->local_file = url_file_name (u);
}
content-type. */
if (!type ||
0 == strncasecmp (type, TEXTHTML_S, strlen (TEXTHTML_S)) ||
- 0 == strncasecmp (type, TEXTXHTML_S, strlen (TEXTXHTML_S)))
+ 0 == strncasecmp (type, TEXTXHTML_S, strlen (TEXTXHTML_S)))
*dt |= TEXTHTML;
else
*dt &= ~TEXTHTML;
/* Print fetch message, if opt.verbose. */
if (opt.verbose)
{
- logprintf (LOG_NOTQUIET, _("Saving to: %s\n"),
+ logprintf (LOG_NOTQUIET, _("Saving to: %s\n"),
HYPHENP (hs->local_file) ? quote ("STDOUT") : quote (hs->local_file));
}
-
+
/* This confuses the timestamping code that checks for file size.
#### The timestamping code should be smarter about file size. */
if (opt.save_headers && hs->restval == 0)
&& (got_name || !opt.content_disposition))
send_head_first = false;
- /* Send preliminary HEAD request if -N is given and we have an existing
+ /* Send preliminary HEAD request if -N is given and we have an existing
* destination file. */
file_name = url_file_name (u);
if (opt.timestamping
&& file_exists_p (file_name))
send_head_first = true;
xfree (file_name);
-
+
/* THE loop */
do
{
logputs (LOG_VERBOSE, "\n");
logprintf (LOG_NOTQUIET, _("Cannot write to %s (%s).\n"),
quote (hstat.local_file), strerror (errno));
- case HOSTERR: case CONIMPOSSIBLE: case PROXERR: case AUTHFAILED:
+ case HOSTERR: case CONIMPOSSIBLE: case PROXERR: case AUTHFAILED:
case SSLINITFAILED: case CONTNOTSUPPORTED: case VERIFCERTERR:
/* Fatal errors just return from the function. */
ret = err;
if (*dt & HEAD_ONLY)
time_came_from_head = true;
}
-
+
if (send_head_first)
{
/* The time-stamping section. */
we're supposed to
download already exists. */
{
- if (hstat.remote_time &&
+ if (hstat.remote_time &&
tmr != (time_t) (-1))
{
/* Now time-stamping can be used validly.
download procedure is resumed. */
if (hstat.orig_file_tstamp >= tmr)
{
- if (hstat.contlen == -1
+ if (hstat.contlen == -1
|| hstat.orig_file_size == hstat.contlen)
{
logprintf (LOG_VERBOSE, _("\
logputs (LOG_VERBOSE, "\n");
}
}
-
+
/* free_hstat (&hstat); */
hstat.timestamp_checked = true;
}
-
+
if (opt.spider)
{
bool finished = true;
Remote file exists and could contain links to other resources -- retrieving.\n\n"));
finished = false;
}
- else
+ else
{
logprintf (LOG_VERBOSE, _("\
Remote file exists but does not contain any link -- not retrieving.\n\n"));
Remote file exists and could contain further links,\n\
but recursion is disabled -- not retrieving.\n\n"));
}
- else
+ else
{
logprintf (LOG_VERBOSE, _("\
Remote file exists.\n\n"));
}
ret = RETROK; /* RETRUNNEEDED is not for caller. */
}
-
+
if (finished)
{
- logprintf (LOG_NONVERBOSE,
- _("%s URL: %s %2d %s\n"),
+ logprintf (LOG_NONVERBOSE,
+ _("%s URL: %s %2d %s\n"),
tms, u->url, hstat.statcode,
hstat.message ? quotearg_style (escape_quoting_style, hstat.message) : "");
goto exit;
continue;
} /* send_head_first */
} /* !got_head */
-
+
if ((tmr != (time_t) (-1))
&& ((hstat.len == hstat.contlen) ||
((hstat.res == 0) && (hstat.contlen == -1))))
bool write_to_stdout = (opt.output_document && HYPHENP (opt.output_document));
logprintf (LOG_VERBOSE,
- write_to_stdout
+ write_to_stdout
? _("%s (%s) - written to stdout %s[%s/%s]\n\n")
: _("%s (%s) - %s saved [%s/%s]\n\n"),
tms, tmrate,
else if (hstat.res == 0) /* No read error */
{
if (hstat.contlen == -1) /* We don't know how much we were supposed
- to get, so assume we succeeded. */
+ to get, so assume we succeeded. */
{
if (*dt & RETROKF)
{
write_to_stdout
? _("%s (%s) - written to stdout %s[%s]\n\n")
: _("%s (%s) - %s saved [%s]\n\n"),
- tms, tmrate,
+ tms, tmrate,
write_to_stdout ? "" : quote (hstat.local_file),
number_to_static_string (hstat.len));
logprintf (LOG_NONVERBOSE,
downloaded_file(FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
else
downloaded_file(FILE_DOWNLOADED_NORMALLY, hstat.local_file);
-
+
ret = RETROK;
goto exit;
}
while (!opt.ntry || (count < opt.ntry));
exit:
- if (ret == RETROK)
+ if (ret == RETROK)
*local_file = xstrdup (hstat.local_file);
free_hstat (&hstat);
-
+
return ret;
}
\f
{
int i;
struct {
- char *hdrval;
+ char *hdrval;
char *opt_dir_prefix;
char *filename;
bool result;
{ "attachment", NULL, NULL, false },
{ "attachment", "somedir", NULL, false },
};
-
- for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i)
+
+ for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i)
{
char *filename;
bool res;
opt.dir_prefix = test_array[i].opt_dir_prefix;
res = parse_content_disposition (test_array[i].hdrval, &filename);
- mu_assert ("test_parse_content_disposition: wrong result",
+ mu_assert ("test_parse_content_disposition: wrong result",
res == test_array[i].result
- && (res == false
+ && (res == false
|| 0 == strcmp (test_array[i].filename, filename)));
}
return home ? xstrdup (home) : NULL;
}
-/* Check the 'WGETRC' environment variable and return the file name
- if 'WGETRC' is set and is a valid file.
+/* Check the 'WGETRC' environment variable and return the file name
+ if 'WGETRC' is set and is a valid file.
If the `WGETRC' variable exists but the file does not exist, the
function will exit(). */
char *
-wgetrc_env_file_name (void)
+wgetrc_env_file_name (void)
{
char *env = getenv ("WGETRC");
if (env && *env)
/* Check for the existance of '$HOME/.wgetrc' and return it's path
if it exists and is set. */
char *
-wgetrc_user_file_name (void)
+wgetrc_user_file_name (void)
{
char *home = home_dir ();
char *file = NULL;
/* Return the path to the user's .wgetrc. This is either the value of
`WGETRC' environment variable, or `$HOME/.wgetrc'.
- Additionally, for windows, look in the directory where wget.exe
+ Additionally, for windows, look in the directory where wget.exe
resides. */
char *
wgetrc_file_name (void)
char *file = wgetrc_env_file_name ();
if (file && *file)
return file;
-
+
file = wgetrc_user_file_name ();
#ifdef WINDOWS
/* Load the hard-coded defaults. */
defaults ();
-
- /* Run a non-standard system rc file when the according environment
+
+ /* Run a non-standard system rc file when the according environment
variable has been set. For internal testing purposes only! */
env_sysrc = getenv ("SYSTEM_WGETRC");
if (env_sysrc && file_exists_p (env_sysrc))
return false;
}
- if (*end)
+ if (*end)
val = end + 1;
}
while (*val && *end);
opt.restrict_files_ctrl = restrict_ctrl;
opt.restrict_files_case = restrict_case;
opt.restrict_files_nonascii = restrict_nonascii;
-
+
return true;
}
xfree_null (opt.user);
xfree_null (opt.passwd);
xfree_null (opt.base_href);
-
+
#endif /* DEBUG_MALLOC */
}
\f
{
mu_assert ("FAILED", false);
break;
- }
+ }
else
- {
+ {
prev_idx ++;
next_idx ++;
}
{ "windows,lowercase", restrict_windows, true, restrict_lowercase, true },
{ "unix,nocontrol,lowercase,", restrict_unix, false, restrict_lowercase, true },
};
-
- for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i)
+
+ for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i)
{
bool res;
-
+
defaults();
res = cmd_spec_restrict_file_names ("dummy", test_array[i].val, NULL);
fprintf (stderr, "opt.restrict_files_ctrl: %d\n", opt.restrict_files_ctrl); fflush (stderr);
fprintf (stderr, "opt.restrict_files_case: %d\n", opt.restrict_files_case); fflush (stderr);
*/
- mu_assert ("test_cmd_spec_restrict_file_names: wrong result",
+ mu_assert ("test_cmd_spec_restrict_file_names: wrong result",
res == test_array[i].result
- && opt.restrict_files_os == test_array[i].expected_restrict_files_os
- && opt.restrict_files_ctrl == test_array[i].expected_restrict_files_ctrl
+ && opt.restrict_files_os == test_array[i].expected_restrict_files_os
+ && opt.restrict_files_ctrl == test_array[i].expected_restrict_files_ctrl
&& opt.restrict_files_case == test_array[i].expected_restrict_files_case);
}
#include <stdio.h>
#include <stdlib.h>
-#include <assert.h>
#include <string.h>
#include <iconv.h>
#include <stringprep.h>
l2u = iconv_open ("UTF-8", opt.locale);
if (l2u != (iconv_t)(-1))
- {
+ {
logprintf (LOG_VERBOSE, _("Conversion from %s to %s isn't supported\n"),
quote (opt.locale), quote ("UTF-8"));
return str;
lines.*/
static void
format_and_print_line (const char *prefix, const char *line,
- int line_length)
+ int line_length)
{
int remaining_chars;
char *line_dup, *token;
-
+
assert (prefix != NULL);
assert (line != NULL);
remaining_chars = line_length;
/* We break on spaces. */
token = strtok (line_dup, " ");
- while (token != NULL)
+ while (token != NULL)
{
/* If however a token is much larger than the maximum
line length, all bets are off and we simply print the
token on the next line. */
- if (remaining_chars <= strlen (token))
+ if (remaining_chars <= strlen (token))
{
printf ("\n%*c", TABULATION, ' ');
remaining_chars = line_length - TABULATION;
/* compiled_features is a char*[]. We limit the characters per
line to MAX_CHARS_PER_LINE and prefix each line with a constant
number of spaces for proper alignment. */
- for (i = 0; compiled_features[i] != NULL; )
+ for (i = 0; compiled_features[i] != NULL; )
{
int line_length = MAX_CHARS_PER_LINE;
- while ((line_length > 0) && (compiled_features[i] != NULL))
+ while ((line_length > 0) && (compiled_features[i] != NULL))
{
printf ("%s ", compiled_features[i]);
line_length -= strlen (compiled_features[i]) + 2;
printf ("\n");
}
printf ("\n");
- /* Handle the case when $WGETRC is unset and $HOME/.wgetrc is
+ /* Handle the case when $WGETRC is unset and $HOME/.wgetrc is
absent. */
printf ("%s\n", wgetrc_title);
env_wgetrc = wgetrc_env_file_name ();
- if (env_wgetrc && *env_wgetrc)
+ if (env_wgetrc && *env_wgetrc)
{
printf (_(" %s (env)\n"), env_wgetrc);
xfree (env_wgetrc);
}
user_wgetrc = wgetrc_user_file_name ();
- if (user_wgetrc)
+ if (user_wgetrc)
{
printf (_(" %s (user)\n"), user_wgetrc);
xfree (user_wgetrc);
LOCALEDIR,
MAX_CHARS_PER_LINE);
#endif /* def ENABLE_NLS */
-
+
format_and_print_line (compile_title,
compilation_string,
MAX_CHARS_PER_LINE);
#endif
if (opt.output_document)
{
- if (opt.convert_links
+ if (opt.convert_links
&& (nurl > 1 || opt.page_requisites || opt.recursive))
{
fputs (_("\
for details.\n\n"));
opt.timestamping = false;
}
- if (opt.noclobber && file_exists_p(opt.output_document))
- {
+ if (opt.noclobber && file_exists_p(opt.output_document))
+ {
/* Check if output file exists; if it does, exit. */
logprintf (LOG_VERBOSE, _("File `%s' already there; not retrieving.\n"), opt.output_document);
exit(1);
- }
+ }
}
if (opt.ask_passwd && opt.passwd)
int old_follow_ftp = opt.follow_ftp;
/* Turn opt.follow_ftp on in case of recursive FTP retrieval */
- if (url_scheme (*t) == SCHEME_FTP)
+ if (url_scheme (*t) == SCHEME_FTP)
opt.follow_ftp = 1;
-
+
status = retrieve_tree (url_parsed, NULL);
opt.follow_ftp = old_follow_ftp;
{
print_broken_links();
}
-
+
/* Print the downloaded sum. */
if ((opt.recursive || opt.page_requisites
|| nurl > 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <assert.h>
#include <errno.h>
#include <math.h>
shift_left(char *string)
{
char *p;
-
+
for (p=string; *p; ++p)
*p = *(p+1);
}
/* Print errors in the OpenSSL error stack. */
static void
-print_errors (void)
+print_errors (void)
{
unsigned long err;
while ((err = ERR_get_error ()) != 0)
Returns true on success, false on failure. */
bool
-ssl_connect_wget (int fd)
+ssl_connect_wget (int fd)
{
SSL *conn;
struct openssl_transport_context *ctx;
char *subject = X509_NAME_oneline (X509_get_subject_name (cert), 0, 0);
char *issuer = X509_NAME_oneline (X509_get_issuer_name (cert), 0, 0);
DEBUGP (("certificate:\n subject: %s\n issuer: %s\n",
- quotearg_style (escape_quoting_style, subject),
+ quotearg_style (escape_quoting_style, subject),
quotearg_style (escape_quoting_style, issuer)));
OPENSSL_free (subject);
OPENSSL_free (issuer);
char *issuer = X509_NAME_oneline (X509_get_issuer_name (cert), 0, 0);
logprintf (LOG_NOTQUIET,
_("%s: cannot verify %s's certificate, issued by %s:\n"),
- severity, quotearg_style (escape_quoting_style, host),
+ severity, quotearg_style (escape_quoting_style, host),
quote (issuer));
/* Try to print more user-friendly (and translated) messages for
the frequent verification errors. */
xentry = X509_NAME_get_entry(xname,i);
sdata = X509_NAME_ENTRY_get_data(xentry);
- if (strlen (common_name) != ASN1_STRING_length (sdata))
+ if (strlen (common_name) != ASN1_STRING_length (sdata))
{
logprintf (LOG_NOTQUIET, _("\
%s: certificate common name is invalid (contains a NUL character).\n\
success = false;
}
}
-
+
if (success)
DEBUGP (("X509 certificate successfully verified and matches host %s\n",
char *user; /* Generic username */
char *passwd; /* Generic password */
bool ask_passwd; /* Ask for password? */
-
+
bool always_rest; /* Always use REST. */
char *ftp_user; /* FTP username */
char *ftp_passwd; /* FTP password */
prefer_none
} prefer_family; /* preferred address family when more
than one type is available */
-
+
bool content_disposition; /* Honor HTTP Content-Disposition header. */
bool auth_without_challenge; /* Issue Basic authentication creds without
waiting for a challenge. */
if (bp->stalled)
{
bp->stalled = false;
- /* "recent_age" includes the the entired stalled period, which
+ /* "recent_age" includes the entired stalled period, which
could be very long. Don't update the speed ring with that
value because the current bandwidth would start too small.
Start with an arbitrary (but more reasonable) time value and
}
/* Measure the elapsed time since timer creation/reset. This causes
- the timer to internally call clock_gettime (or gettimeofday, etc.)
+ the timer to internally call clock_gettime (or gettimeofday, etc.)
to update its idea of current time. The time is returned, but is
also stored for later access through ptimer_read().
bool ret = are_urls_equal (url, robots_url);
xfree (robots_url);
-
+
return ret;
}
\f
{ "http://www.yoyodyne.com/somepath/", false },
{ "http://www.yoyodyne.com/somepath/robots.txt", false },
};
-
- for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i)
+
+ for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i)
{
- mu_assert ("test_is_robots_txt_url: wrong result",
+ mu_assert ("test_is_robots_txt_url: wrong result",
is_robots_txt_url (test_array[i].url) == test_array[i].expected_result);
}
* original. Also, there is now a builtin-test, just compile with:
* gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
* and run snprintf for results.
- *
+ *
* Thomas Roessler <roessler@guug.de> 01/27/98 for mutt 0.89i
- * The PGP code was using unsigned hexadecimal formats.
+ * The PGP code was using unsigned hexadecimal formats.
* Unfortunately, unsigned formats simply didn't work.
*
* Michael Elkins <me@cs.hmc.edu> 03/05/98 for mutt 0.90.8
int cflags;
int total;
size_t currlen;
-
+
state = DP_S_DEFAULT;
currlen = flags = cflags = min = 0;
max = -1;
if (ch == '\0')
state = DP_S_DONE;
- switch(state)
+ switch(state)
{
case DP_S_DEFAULT:
- if (ch == '%')
+ if (ch == '%')
state = DP_S_FLAGS;
- else
+ else
total += dopr_outch (buffer, &currlen, maxlen, ch);
ch = *format++;
break;
case DP_S_FLAGS:
- switch (ch)
+ switch (ch)
{
case '-':
flags |= DP_F_MINUS;
{
min = 10*min + char_to_int (ch);
ch = *format++;
- }
- else if (ch == '*')
+ }
+ else if (ch == '*')
{
min = va_arg (args, int);
ch = *format++;
state = DP_S_DOT;
- }
- else
+ }
+ else
state = DP_S_DOT;
break;
case DP_S_DOT:
- if (ch == '.')
+ if (ch == '.')
{
state = DP_S_MAX;
ch = *format++;
- }
- else
+ }
+ else
state = DP_S_MOD;
break;
case DP_S_MAX:
max = 0;
max = 10*max + char_to_int (ch);
ch = *format++;
- }
- else if (ch == '*')
+ }
+ else if (ch == '*')
{
max = va_arg (args, int);
ch = *format++;
state = DP_S_MOD;
- }
- else
+ }
+ else
state = DP_S_MOD;
break;
case DP_S_MOD:
- switch (ch)
+ switch (ch)
{
case 'h':
cflags = DP_C_SHORT;
state = DP_S_CONV;
break;
case DP_S_CONV:
- switch (ch)
+ switch (ch)
{
case 'd':
case 'i':
- if (cflags == DP_C_SHORT)
+ if (cflags == DP_C_SHORT)
value = (short int) va_arg (args, int);
else if (cflags == DP_C_LONG)
value = va_arg (args, long int);
max, flags);
break;
case 'n':
- if (cflags == DP_C_SHORT)
+ if (cflags == DP_C_SHORT)
{
short int *num;
num = va_arg (args, short int *);
*num = currlen;
}
- else if (cflags == DP_C_LONG)
+ else if (cflags == DP_C_LONG)
{
long int *num;
num = va_arg (args, long int *);
*num = currlen;
- }
- else if (cflags == DP_C_LLONG)
+ }
+ else if (cflags == DP_C_LLONG)
{
LLONG *num;
num = va_arg (args, LLONG *);
*num = currlen;
- }
- else
+ }
+ else
{
int *num;
num = va_arg (args, int *);
}
if (buffer != NULL)
{
- if (currlen < maxlen - 1)
+ if (currlen < maxlen - 1)
buffer[currlen] = '\0';
- else
+ else
buffer[maxlen - 1] = '\0';
}
return total;
int padlen, strln; /* amount to pad */
int cnt = 0;
int total = 0;
-
+
if (value == 0)
{
value = "(null)";
for (strln = 0; strln < max && value[strln]; ++strln)
;
padlen = min - strln;
- if (padlen < 0)
+ if (padlen < 0)
padlen = 0;
- if (flags & DP_F_MINUS)
+ if (flags & DP_F_MINUS)
padlen = -padlen; /* Left Justify */
while (padlen > 0)
int zpadlen = 0; /* amount to zero pad */
const char *digits;
int total = 0;
-
+
if (max < 0)
max = 0;
if (flags & DP_F_SPACE)
signvalue = ' ';
}
-
+
if (flags & DP_F_UP)
/* Should characters be upper case? */
digits = "0123456789ABCDEF";
zpadlen = MAX(zpadlen, spadlen);
spadlen = 0;
}
- if (flags & DP_F_MINUS)
+ if (flags & DP_F_MINUS)
spadlen = -spadlen; /* Left Justifty */
#ifdef DEBUG_SNPRINTF
#endif
/* Spaces */
- while (spadlen > 0)
+ while (spadlen > 0)
{
total += dopr_outch (buffer, currlen, maxlen, ' ');
--spadlen;
}
/* Sign */
- if (signvalue)
+ if (signvalue)
total += dopr_outch (buffer, currlen, maxlen, signvalue);
/* Zeros */
- if (zpadlen > 0)
+ if (zpadlen > 0)
{
while (zpadlen > 0)
{
}
/* Digits */
- while (place > 0)
+ while (place > 0)
total += dopr_outch (buffer, currlen, maxlen, convert[--place]);
-
+
/* Left Justified spaces */
while (spadlen < 0) {
total += dopr_outch (buffer, currlen, maxlen, ' ');
result *= 10;
exp--;
}
-
+
return result;
}
int iplace = 0;
int fplace = 0;
int padlen = 0; /* amount to pad */
- int zpadlen = 0;
+ int zpadlen = 0;
int total = 0;
LLONG intpart;
LLONG fracpart;
int leadingfrac0s = 0; /* zeros at the start of fractional part */
int omitzeros = 0;
int omitcount = 0;
-
- /*
+
+ /*
* AIX manpage says the default is 0, but Solaris says the default
* is 6, and sprintf on AIX defaults to 6
*/
# define MAX_DIGITS 9 /* just long */
#endif
- /*
+ /*
* Sorry, we only support several digits past the decimal because of
* our conversion method
*/
zpadlen = max - fplace;
if (zpadlen < 0)
zpadlen = 0;
- if (padlen < 0)
+ if (padlen < 0)
padlen = 0;
- if (flags & DP_F_MINUS)
+ if (flags & DP_F_MINUS)
padlen = -padlen; /* Left Justifty */
- if ((flags & DP_F_ZERO) && (padlen > 0))
+ if ((flags & DP_F_ZERO) && (padlen > 0))
{
- if (signvalue)
+ if (signvalue)
{
total += dopr_outch (buffer, currlen, maxlen, signvalue);
--padlen;
total += dopr_outch (buffer, currlen, maxlen, ' ');
--padlen;
}
- if (signvalue)
+ if (signvalue)
total += dopr_outch (buffer, currlen, maxlen, signvalue);
- while (iplace > 0)
+ while (iplace > 0)
total += dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]);
/*
{
total += dopr_outch (buffer, currlen, maxlen, '.');
- while (fplace > omitcount)
+ while (fplace > omitcount)
total += dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]);
}
--zpadlen;
}
- while (padlen < 0)
+ while (padlen < 0)
{
total += dopr_outch (buffer, currlen, maxlen, ' ');
++padlen;
#endif
NULL
};
- double fp_nums[] = { -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996,
+ double fp_nums[] = { -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996,
0.9996, 1.996, 4.136, 0.00205, 0.0001, 321.000009,
0};
char *int_fmt[] = {
sprintf (buf2, fp_fmt[x], fp_nums[y]);
if (strcmp (buf1, buf2))
{
- printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
+ printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
fp_fmt[x], buf1, buf2);
fail++;
}
sprintf (buf2, int_fmt[x], int_nums[y]);
if (strcmp (buf1, buf2))
{
- printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
+ printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
int_fmt[x], buf1, buf2);
fail++;
}
sprintf (buf2, llong_fmt[x], llong_nums[y]);
if (strcmp (buf1, buf2))
{
- printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
+ printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
llong_fmt[x], buf1, buf2);
fail++;
}
{
hash_table_iterator iter;
int num_elems;
-
- if (!nonexisting_urls_set)
+
+ if (!nonexisting_urls_set)
{
logprintf (LOG_NOTQUIET, _("Found no broken links.\n\n"));
return;
}
-
+
num_elems = hash_table_count (nonexisting_urls_set);
assert (num_elems > 0);
logprintf (LOG_NOTQUIET, ngettext("Found %d broken link.\n\n",
"Found %d broken links.\n\n", num_elems),
num_elems);
-
+
for (hash_table_iterate (nonexisting_urls_set, &iter);
hash_table_iter_next (&iter); )
{
/* Struct url_list *list; */
const char *url = (const char *) iter.key;
-
+
logprintf (LOG_NOTQUIET, _("%s\n"), url);
}
logputs (LOG_NOTQUIET, "\n");
mu_run_test (test_append_uri_pathel);
mu_run_test (test_are_urls_equal);
mu_run_test (test_is_robots_txt_url);
-
+
return NULL;
}
char *program_name; /* Needed by lib/error.c. */
int
-main (int argc, char *argv[])
+main (int argc, char *argv[])
{
const char *result;
program_name = argv[0];
result = all_tests();
-
- if (result != NULL)
+
+ if (result != NULL)
{
puts (result);
}
- else
+ else
{
printf ("ALL TESTS PASSED\n");
}
-
+
printf ("Tests run: %d\n", tests_run);
-
+
return result != 0;
}
}
assert (q - TAIL (dest) == outlen);
}
-
+
/* Perform inline case transformation if required. */
if (opt.restrict_files_case == restrict_lowercase
|| opt.restrict_files_case == restrict_uppercase)
*q = c_toupper (*q);
}
}
-
+
TAIL_INCR (dest, outlen);
}
/* If an alternative index file was defined, change index_filename */
if (opt.default_page)
index_filename = opt.default_page;
-
+
/* Start with the directory prefix, if specified. */
if (opt.dir_prefix)
}
\f
/* Return true if scheme a is similar to scheme b.
-
+
Schemes are similar if they are equal. If SSL is supported, schemes
are also similar if one is http (SCHEME_HTTP) and the other is https
(SCHEME_HTTPS). */
{ "http://www.yoyodyne.com/path/", "somepage.html", false, "http://www.yoyodyne.com/path/somepage.html" },
};
- for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i)
+ for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i)
{
struct growable dest;
const char *p = test_array[i].input;
-
+
memset (&dest, 0, sizeof (dest));
-
+
append_string (test_array[i].original_url, &dest);
append_uri_pathel (p, p + strlen(p), test_array[i].escaped, &dest);
append_char ('\0', &dest);
- mu_assert ("test_append_uri_pathel: wrong result",
+ mu_assert ("test_append_uri_pathel: wrong result",
strcmp (dest.base, test_array[i].expected_result) == 0);
}
{ "http://www.adomain.com/longer-path/", "http://www.adomain.com/path/", false },
{ "http://www.adomain.com/path%2f", "http://www.adomain.com/path/", false },
};
-
- for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i)
+
+ for (i = 0; i < sizeof(test_array)/sizeof(test_array[0]); ++i)
{
- mu_assert ("test_are_urls_equal: wrong result",
+ mu_assert ("test_are_urls_equal: wrong result",
are_urls_equal (test_array[i].url1, test_array[i].url2) == test_array[i].expected_result);
}
#ifdef TESTING
#include "test.h"
-#endif
+#endif
static void
memfatal (const char *context, long attempted_size)
fallback implementation of vsnprintf, this should be portable. */
/* Constant is using for limits memory allocation for text buffer.
- Applicable in situation when: vasprintf is not available in the system
+ Applicable in situation when: vasprintf is not available in the system
and vsnprintf return -1 when long line is truncated (in old versions of
glibc and in other system where C99 doesn`t support) */
else if (size >= FMT_MAX_LENGTH) /* We have a huge buffer, */
{ /* maybe we have some wrong
format string? */
- logprintf (LOG_ALWAYS,
+ logprintf (LOG_ALWAYS,
_("%s: aprintf: text buffer is too big (%ld bytes), "
"aborting.\n"),
exec_name, size); /* printout a log message */
If opening the file fails for any reason, including the file having
previously existed, this function returns NULL and sets errno
appropriately. */
-
+
FILE *
fopen_excl (const char *fname, int binary)
{
}
/* Check if D2 is a subdirectory of D1. E.g. if D1 is `/something', subdir_p()
- will return true if and only if D2 begins with `/something/' or is exactly
+ will return true if and only if D2 begins with `/something/' or is exactly
'/something'. */
bool
subdir_p (const char *d1, const char *d2)
else
for (; *d1 && *d2 && (c_tolower (*d1) == c_tolower (*d2)); ++d1, ++d2)
;
-
+
return *d1 == '\0' && (*d2 == '\0' || *d2 == '/');
}
break;
}
}
-
+
return *x ? true : false;
}
/* Return true if FNAME ends with a typical HTML suffix. The
following (case-insensitive) suffixes are presumed to be HTML
files:
-
+
html
htm
?html (`?' matches one character)
{ "/somedir", "/somedir/d2", true },
{ "/somedir/d1", "/somedir", false },
};
-
- for (i = 0; i < countof(test_array); ++i)
+
+ for (i = 0; i < countof(test_array); ++i)
{
bool res = subdir_p (test_array[i].d1, test_array[i].d2);
- mu_assert ("test_subdir_p: wrong result",
+ mu_assert ("test_subdir_p: wrong result",
res == test_array[i].result);
}
{ { "/Tmp/has", NULL, NULL }, "/Tmp/has space", false },
{ { "/Tmp/has", NULL, NULL }, "/Tmp/has,comma", false },
};
-
- for (i = 0; i < countof(test_array); ++i)
+
+ for (i = 0; i < countof(test_array); ++i)
{
bool res = dir_matches_p (test_array[i].dirlist, test_array[i].dir);
-
- mu_assert ("test_dir_matches_p: wrong result",
+
+ mu_assert ("test_dir_matches_p: wrong result",
res == test_array[i].result);
}
/* 0 */
NOCONERROR, HOSTERR, CONSOCKERR, CONERROR, CONSSLERR,
CONIMPOSSIBLE, NEWLOCATION, NOTENOUGHMEM /* ! */,
- CONPORTERR /* ! */, CONCLOSED /* ! */,
+ CONPORTERR /* ! */, CONCLOSED /* ! */,
/* 10 */
FTPOK, FTPLOGINC, FTPLOGREFUSED, FTPPORTERR, FTPSYSERR,
- FTPNSFOD, FTPRETROK /* ! */, FTPUNKNOWNTYPE, FTPRERR, FTPREXC /* ! */,
+ FTPNSFOD, FTPRETROK /* ! */, FTPUNKNOWNTYPE, FTPRERR, FTPREXC /* ! */,
/* 20 */
- FTPSRVERR, FTPRETRINT, FTPRESTFAIL, URLERROR, FOPENERR,
+ FTPSRVERR, FTPRETRINT, FTPRESTFAIL, URLERROR, FOPENERR,
FOPEN_EXCL_ERR, FWRITEERR, HOK /* ! */, HLEXC /* ! */, HEOF,
/* 30 */
HERR, RETROK, RECLEVELEXC, FTPACCDENIED /* ! */, WRONGCODE,
- FTPINVPASV, FTPNOPASV, CONTNOTSUPPORTED, RETRUNNEEDED, RETRFINISHED,
+ FTPINVPASV, FTPNOPASV, CONTNOTSUPPORTED, RETRUNNEEDED, RETRFINISHED,
/* 40 */
- READERR, TRYLIMEXC, URLBADPATTERN /* ! */, FILEBADFILE /* ! */, RANGEERR,
+ READERR, TRYLIMEXC, URLBADPATTERN /* ! */, FILEBADFILE /* ! */, RANGEERR,
RETRBADPATTERN, RETNOTSUP /* ! */, ROBOTSOK /* ! */, NOROBOTS /* ! */,
- PROXERR,
+ PROXERR,
/* 50 */
AUTHFAILED, QUOTEXC, WRITEFAILED, SSLINITFAILED, VERIFCERTERR
} uerr_t;
2009-04-11 Steven Schubiger <stsc@member.fsf.org>
- * run-px: Skip testing with real rc files by setting
+ * run-px: Skip testing with real rc files by setting
SYSTEM_WGETRC and WGETRC to /dev/null.
2009-02-25 Benjamin Wolsey <bwy@benjaminwolsey.de>
* Test-auth-basic.px, Test-auth-no-challenge.px,
Test-auth-no-challenge-url.px, Test-c-full.px,
Test-c-partial.px, Test-c.px, Test-c-shorter.px,
- Test-E-k-K.px, Test-E-k.px, Test-ftp.px,
- Test-HTTP-Content-Disposition-1.px,
+ Test-E-k-K.px, Test-E-k.px, Test-ftp.px,
+ Test-HTTP-Content-Disposition-1.px,
Test-HTTP-Content-Disposition-2.px,
Test-HTTP-Content-Disposition.px, Test-N-current.px,
Test-N-HTTP-Content-Disposition.px,
Test-N-no-info.px, Test--no-content-disposition.px,
Test--no-content-disposition-trivial.px, Test-N-old.px,
Test-nonexisting-quiet.px, Test-noop.px, Test-np.px,
- Test-N.px, Test-N-smaller.px,
+ Test-N.px, Test-N-smaller.px,
Test-O-HTTP-Content-Disposition.px, Test-O-nc.px,
- Test-O--no-content-disposition.px,
+ Test-O--no-content-disposition.px,
Test-O--no-content-disposition-trivial.px,
Test-O-nonexisting.px, Test-O.px,
Test-proxy-auth-basic.px, Test-Restrict-Lowercase.px,
2006-05-26 Mauro Tortonesi <mauro@ferrara.linux.it>
- * HTTPServer.pm: Fixed bug when returning 404. Improved logging.
+ * HTTPServer.pm: Fixed bug when returning 404. Improved logging.
* Test.pm: Added support for command lines which use an absolute path
for the Wget binary.
* HTTPTest.pm: Updated to new test format.
- * Test.pm: Improved test setup, verification and cleanup. Major
+ * Test.pm: Improved test setup, verification and cleanup. Major
refactoring.
* Test1.px: Updated to new test format.
2005-12-05 Mauro Tortonesi <mauro@ferrara.linux.it>
- * HTTPServer.pm: Refactored as a subclass of HTTP::Daemon.
- Removed the old run method and renamed the old run_daemon
- method to run. Added support for partial
+ * HTTPServer.pm: Refactored as a subclass of HTTP::Daemon.
+ Removed the old run method and renamed the old run_daemon
+ method to run. Added support for partial
* Testing.pm: Renamed to HTTPTest.pm.
- * HTTPTest.pm: Refactored as a subclass of Test. Renamed
- Run_HTTP_Test to run, verify_download to _verify_download
+ * HTTPTest.pm: Refactored as a subclass of Test. Renamed
+ Run_HTTP_Test to run, verify_download to _verify_download
and added support for timestamp checking.
- * Test.pm: Added Test class as the super class of every
+ * Test.pm: Added Test class as the super class of every
testcase.
* test1: Renamed to Test1.px.
$_attr_data{$attr};
}
- sub _standard_keys
+ sub _standard_keys
{
keys %_attr_data;
}
print STDERR "in child\n" if $log;
- my $conn = {
+ my $conn = {
'paths' => FTPPaths->new($self->{'_input'},
$self->{'_server_behavior'}),
- 'socket' => $socket,
+ 'socket' => $socket,
'state' => $_connection_states{NEWCONN},
'dir' => '/',
'restart' => 0,
my $info = $self->get_info($path);
return undef unless defined $info;
my $list = [];
-
+
if ($info->{'_type'} eq 'd') {
for my $item (keys %$info) {
next if $item =~ /^_/;
return $self->SUPER::_default_for($attr);
}
- sub _standard_keys
+ sub _standard_keys
{
my ($self) = @_;
($self->SUPER::_standard_keys(), keys %_attr_data);
###############################################################################
my $the_test = HTTPTest->new (name => "Test--no-content-disposition-trivial",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test--no-content-disposition",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test--spider-fail",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test--spider-r--no-content-disposition-trivial",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test--spider-r--no-content-disposition",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test--spider-r-HTTP-Content-Disposition",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test--spider-r",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test--spider",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-E-k-K",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-E-k",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition-1",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
existing => \%existing_files,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition-2",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
existing => \%existing_files,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-N--no-content-disposition-trivial",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-N--no-content-disposition",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-N-HTTP-Content-Disposition",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-N-current",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
existing => \%existing_files,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-N-current",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
existing => \%existing_files,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-N-old",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
existing => \%existing_files,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-N-current",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
existing => \%existing_files,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-N",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-O--no-content-disposition-trivial",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-O--no-content-disposition",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-O-HTTP-Content-Disposition",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-O-nc",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-O-nonexisting",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-O",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-Restrict-Lowercase",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-Restrict-Uppercase",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-auth-basic",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-auth-no-challenge-url",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-auth-no-challenge",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-auth-with-content-disposition",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-c-full",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
existing => \%existing_files,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-c-partial",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
existing => \%existing_files,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-c-partial",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
existing => \%existing_files,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-c",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
existing => \%existing_files,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-cookies-401",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-cookies",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = FTPTest->new (name => "Test-ftp-bad-list",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files,
existing => \%preexisting_files,
server_behavior => {bad_list => 1});
###############################################################################
my $the_test = FTPTest->new (name => "Test-ftp-iri",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = FTPTest->new (name => "Test-ftp-iri",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = FTPTest->new (name => "Test-ftp-iri-recursive",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = FTPTest->new (name => "Test-ftp-iri",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
my $the_test = FTPTest->new (name => "Test-ftp-pasv-fail",
server_behavior => {fail_on_pasv => 1},
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = FTPTest->new (name => "Test-ftp-recursive",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = FTPTest->new (name => "Test-ftp",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-idn-cmd",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-idn-headers",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-idn-meta",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-idn-robots",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-iri-disabled",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-iri-forced-remote",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-iri-list",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-meta-robots",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-nonexisting-quiet",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-noop",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
<body>
<p>
This page is only linked by the higher level page. Therefore, it should not
- be downloaded.
+ be downloaded.
</p>
</body>
</html>
<body>
<p>
This page is on a higher level in the URL path hierarchy. Therefore, it
- should not be downloaded. Wget should not visit the following link to a
+ should not be downloaded. Wget should not visit the following link to a
<a href="http://localhost:{{port}}/firstlevel/fourthpage.html">fourth page</a>.
</p>
</body>
###############################################################################
my $the_test = HTTPTest->new (name => "Test-np",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-auth-basic",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
###############################################################################
my $the_test = HTTPTest->new (name => "Test-restrict-ascii",
- input => \%urls,
- cmdline => $cmdline,
- errcode => $expected_error_code,
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
output => \%expected_downloaded_files);
exit $the_test->run();
# CLEAN_ALL deletes all generated files, except the main (collected)
# source dependency file.
#
-# CLEAN_EXE deletes only the architecture-specific executable.
+# CLEAN_EXE deletes only the architecture-specific executable.
# Handy if all you wish to do is re-link the executable.
#
# will need to recover it from the original distribution kit.
#
# Note: This dependency generation scheme assumes that the dependencies
-# do not depend on host architecture type or other such variables.
+# do not depend on host architecture type or other such variables.
# Therefore, no "#include" directive in the C source itself should be
# conditional on such variables.
#
# The ultimate product, a comprehensive dependency list.
-DEPS_FILE = [-.VMS]descrip_deps.mms
+DEPS_FILE = [-.VMS]descrip_deps.mms
# Detect valid qualifier and/or macro options.
SSL_LINK_OPT = , [-.VMS]WGET_SSL.OPT /OPTIONS
.ELSE # SSL
SSL_CDEFINES =
-SSL_LINK_OPT =
+SSL_LINK_OPT =
.ENDIF # SSL
.ENDIF # HPSSL
$(CFLAGS_INCL) \
$(CFLAGS_PREFIX) \
/object = $(MMS$TARGET)
-
+
LINKFLAGS = $(LINKFLAGS_DBG) $(LINKFLAGS_LIST) \
/executable = $(MMS$TARGET)
$! To prevent automatic detection and use of OpenSSL, add "NOSSL"
$! to the command line. This procedure prefers a generic SSL kit to HP
$! SSL. If the generic logical names OPENSSL and SSLLIB are defined,
-$! they will be used instead of the the HP SSL logical names SSL$INCLUDE
+$! they will be used instead of the HP SSL logical names SSL$INCLUDE
$! and SYS$SHARE. To use HP SSL when these generic logical names are
$! defined, add "HPSSL" to the command line.
$!
- Changed to avoid trying "LIST -a" for a VMS FTP server.
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 1.10.2c 2006-11-16
----------------------------
MultiNet versions where the old MultiNet-specific changes are still
needed, specify "MULTINET" on the VMS-WGET.COM command line.
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 1.10.2b 2004-12-15
----------------------------
- Changed the I/O scheme on VMS for progress dots to avoid spurious
newline characters when output is directed to a file.
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 1.10.2a 2004-10-13
----------------------------
directory listing format confused the program. The typical symptom
was "No such file `-rwx---r-x'." The added "CWD []" command resets
the TCPware server to VMS mode, and should be harmless on other VMS
- FTP servers.
+ FTP servers.
- VMS-WGET.COM now finds MMK when it's on DCL$PATH as well as when a
foreign command symbol "MMK" is defined.
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 1.10.1a 2004-09-09
---------------------------
- VMS-WGET.COM may now be run from any default directory, not only
[.SRC].
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 1.9.1e 2005-09-09
--------------------------
(was none), speeding creation of a large output file. Explicitly set
RMS_DEFAULT values override built-in defaults.
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 1.9.1c 2004-12-15
--------------------------
redefined. at line number 178 in module NETDB of text library
SYS$COMMON:[SYSLIB]DECC$RTLDEF.TLB;1
- - A run-time problem with an FTP URL. Typical symptom:
+ - A run-time problem with an FTP URL. Typical symptom:
accept: bad address
- Changed VMS.C to fix a problem with the utime() function (supplied
with Wget) when the user specified a non-UNIX file name with the Wget
- "-O" option. Typical symptom:
+ "-O" option. Typical symptom:
utime(home_sms:[sms.wget]t.h): error 0
VMS-WGET.COM. New: DESCRIP_DEPS.MMS, DESCRIP_MKDEPS.MMS,
DESCRIP_SRC.MMS, COLLECT_DEPS.COM, and MOD_DEP.COM.
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 1.9.1b 2004-09-28
--------------------------
disk:[xxx.WGET-1_9_1A_VMS.SRC]VMS.C;1
- Fixed a build problem with C RTL before VMS V7.3 with C Runtime ECO
- 2 on Alpha:
+ 2 on Alpha:
%CC-I-IMPLICITFUNC, In this statement, the identifier
"decc$feature_get_index" is implicitly declared as a function.
at line number 155 in file disk:[xxx.WGET-1_9_1A_VMS.SRC]VMS.C;1
"decc$feature_set_value" is implicitly declared as a function.
at line number 169 in file disk:[xxx.WGET-1_9_1A_VMS.SRC]VMS.C;1
- and the related:
+ and the related:
%LINK-W-NUDFSYMS, 3 undefined symbols:
%LINK-I-UDFSYM, DECC$FEATURE_GET_INDEX
caused a run-time problem on non-VAX systems with some ODS5
extended file specifications with multiple dots in file names,
typically when "-m" ("--mirror"), "-O" ("--output-document"), or
- "-r" ("--recursive") was used:
+ "-r" ("--recursive") was used:
hostname/test/a.B.c: file specification syntax error
or
rms-f-syn, file specification syntax error
- Fixed a spurious diagnostic message when doing HTTP and
- complex FTP transfers:
+ complex FTP transfers:
utime(). sys$parse() = 00010001.
attempt to puzzle out whether "/one/two" should really be interpreted
as "one:[two]", but it's better equipped to do it than Wget is.
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 1.9.1a 2004-04-28
--------------------------
- Changes to VMS-WGET.COM since Wget 1.5.3h:
- A separate LIST command-line option now controls compiler listing
- files. The DBG option no longer implies compiler listing files.
+ files. The DBG option no longer implies compiler listing files.
The LIST option also generates a link map with cross-reference.
- The DBG option may actually work now.
- Compiler listing files (.LIS) and link maps (.MAP) are now put into
the system-specific directory with the corresponding object files
- (.OBJ), namely, [.SRC.ALPHA], [.SRC.IA64], or [.SRC.VAX].
+ (.OBJ), namely, [.SRC.ALPHA], [.SRC.IA64], or [.SRC.VAX].
Previously, they were put into the source directory ([.SRC])
itself.
vms.h VMS-specific header file. For VMS C RTL before
V7.3, replacement for <utime.h>. For VMS C RTL
- before V7.0, replacement for <pwd.h>.
+ before V7.0, replacement for <pwd.h>.
Declarations of replacement data
types/structures and function prototypes for
vms.c.
host.c Added code for VMS header files.
host.h Added code for VMS header files.
-
+
http.c Added code for VMS header files.
Changed to use an OS-specific file name suffix,
"_orig" for VMS, rather than a hard-coded
that the "FILE" be in Stream_LF format. (In this case, HTTP 1.0
requires the length of the request to be known, and the method used to
determine the size of the file will fail for Variable-length format
- files.)
+ files.)
*
* Simplifies a fancy URL-derived file name into an ODS2- or
* ODS5-compatible file name.
- *
+ *
*----------------------------------------------------------------------
*
* utime()
/*--------------------------------------------------------------------*/
/* vms_arch()
-
+
Returns (run-time) VMS architecture string.
*/
/*--------------------------------------------------------------------*/
/* vms_vers()
-
+
Returns (run-time) VMS version string.
*/
2006-12-29 Gisle Vanem <giva@bgnett.no>
* config.h: Added 'HAVE_SYS_UTIME_H 1' which gets undefined as needed
- in config-compiler.h.
+ in config-compiler.h.
* config-compiler.h: Added '_WIN32_WINNT=0x0501' as needed to pull in
the prototype of getaddrinfo() and other library functions. Defined
2005-02-10 Mauro Tortonesi <mauro@ferrara.linux.it>
- * Makefile.src: Renamed string.{c,h} to string_t.{c,h} to fix
- a compilation conflict with the string.h header in the standard
+ * Makefile.src: Renamed string.{c,h} to string_t.{c,h} to fix
+ a compilation conflict with the string.h header in the standard
C library.
- * Makefile.src.bor: Renamed string.{c,h} to string_t.{c,h} to fix
- a compilation conflict with the string.h header in the standard
+ * Makefile.src.bor: Renamed string.{c,h} to string_t.{c,h} to fix
+ a compilation conflict with the string.h header in the standard
C library.
* Makefile.src.mingw: Renamed string.{c,h} to string_t.{c,h} to fix
- a compilation conflict with the string.h header in the standard
+ a compilation conflict with the string.h header in the standard
C library.
* Makefile.src.watcom: Renamed string.{c,h} to string_t.{c,h} to fix
- a compilation conflict with the string.h header in the standard
+ a compilation conflict with the string.h header in the standard
C library.
* wget.dep: Renamed string.{c,h} to string_t.{c,h} to fix a
$(RM) wget.zip
$(RM) cacert.pem
src\wget http://curl.haxx.se/ca/cacert.pem
- zip -Djl9 wget.zip AUTHORS COPYING INSTALL MAILING-LIST NEWS README doc/sample.wgetrc
- zip -Dj9 wget.zip src/wget.exe doc/wget.hlp cacert.pem
+ zip -Djl9 wget.zip AUTHORS COPYING INSTALL MAILING-LIST NEWS README doc/sample.wgetrc
+ zip -Dj9 wget.zip src/wget.exe doc/wget.hlp cacert.pem
zip -Dj9 wget.zip c:\openssl\bin\libeay32.dll c:\openssl\bin\ssleay32.dll c:\openssl\bin\msvcr80.dll
# default target
all: Makefile $(SUBDIRS)
-$(SUBDIRS):
+$(SUBDIRS):
cd $@
$(MAKEDIR)\$(MAKE)
cd ..
$(RM) wget.zip
$(RM) cacert.pem
src\wget http://curl.haxx.se/ca/cacert.pem
- zip -Djl9 wget.zip AUTHORS COPYING INSTALL MAILING-LIST NEWS README doc/sample.wgetrc
- zip -Dj9 wget.zip src/wget.exe doc/wget.hlp cacert.pem
+ zip -Djl9 wget.zip AUTHORS COPYING INSTALL MAILING-LIST NEWS README doc/sample.wgetrc
+ zip -Dj9 wget.zip src/wget.exe doc/wget.hlp cacert.pem
zip -Dj9 wget.zip c:\openssl\bin\libeay32.dll c:\openssl\bin\ssleay32.dll c:\openssl\bin\msvcr80.dll
compiler you intend to use to build Wget and follow the (brief)
instructions printed on the screen. The instructions bellow are for
building Wget with Microsoft Visual C++ (MSVC); you may need to make
-appropriate substitutions for your compiler and build environment;
-currently wget can be built at least with Visual Studio/.Net, the free
+appropriate substitutions for your compiler and build environment;
+currently wget can be built at least with Visual Studio/.Net, the free
Borland compiler, and the free mingw environment. The instructions do
*not* apply to the Cygwin environment, on which Wget is built with the
procedure described in the INSTALL file in the top-level directory.
To build Wget with MSVC run configure.bat (in the main Wget directory)
with the argument --msvc, and then run nmake. At a certain point in time
-Wget exposed some compiler bugs in MSVC 5.0; later Wget started to
-expose (at least http.c, retr.c) some other compiler bugs in MSVC 6.0
-SP6 (cl.exe version 12) which could/can be worked around by compiling
-completely without optimization or at least partially (by using
+Wget exposed some compiler bugs in MSVC 5.0; later Wget started to
+expose (at least http.c, retr.c) some other compiler bugs in MSVC 6.0
+SP6 (cl.exe version 12) which could/can be worked around by compiling
+completely without optimization or at least partially (by using
#pragma optimize("g",on) and "off" around offending functions).
However, read the rest of this document before continuing.
(libeay32.lib and ssleay32.lib) to
"C:\Program Files\Microsoft Visual Studio\VC98\lib". These locations
aren't exactly the best but will get you started if you don't know where
-to place these headers and libraries, you should find similar paths for
+to place these headers and libraries, you should find similar paths for
later compiler versions. Usually at run-time some OpenSSL
libraries (currently ssleay32.dll and libeay32.dll) will need to be
available in your environment PATH.