]> sjero.net Git - wget/commitdiff
Merge SFLC licensing changes for OpenSSL with tip.
authorMicah Cowan <micah@cowan.name>
Sat, 8 Dec 2007 01:37:07 +0000 (17:37 -0800)
committerMicah Cowan <micah@cowan.name>
Sat, 8 Dec 2007 01:37:07 +0000 (17:37 -0800)
49 files changed:
1  2 
ChangeLog
Makefile.am
README
configure.ac
m4/wget.m4
msdos/ChangeLog
msdos/config.h
src/ChangeLog
src/Makefile.am
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-ntlm.c
src/http.c
src/init.c
src/log.c
src/main.c
src/mswindows.c
src/mswindows.h
src/netrc.c
src/openssl.c
src/progress.c
src/ptimer.c
src/recur.c
src/res.c
src/retr.c
src/spider.c
src/sysdep.h
src/url.c
src/utils.c
src/wget.h
src/xmalloc.c
tests/ChangeLog
tests/Makefile.am
util/Makefile.am
windows/ChangeLog
windows/Makefile.am
windows/config-compiler.h

diff --combined ChangeLog
index 50afcdda86773d571bbe43bc60f159c9cff544a4,91de4f375e99cfeec98adf41348d87d2b974c4a9..9b45286348c5da9fa932427576e92647f47c38dd
+++ b/ChangeLog
 -      * Makefile.in, README, autogen.sh, configure.bat, configure.in,
 -      m4/wget.m4, util/Makefile.in, util/dist-wget: Updated license
+ 2007-11-28  Micah Cowan  <micah@cowan.name>
++      * Makefile.am, README, autogen.sh, configure.bat, configure.in,
++      m4/wget.m4, util/Makefile.am, util/dist-wget: Updated license
+       exception for OpenSSL, per the SFLC.
 +2007-10-23  Micah Cowan  <micah@schmendrick>
 +
 +      * lib/stdbool.in.h, lib/stdint.in.h: gnulib-tool --update.
 +      Includes fix for broken stdbool.h on Tru64.
 +
 +2007-10-22  Micah Cowan  <micah@cowan.name>
 +
 +      * po/*.po: Refresh from TP and update-po.
 +      * lib/Makefile.am, m4/gnulib-cache.m4, m4/longlong.m4,
 +      m4/ulonglong.m4, maint.mk:  gnulib-tool --update. Includes fix
 +      for maint.mk with old versions of gzip.
 +
 +2007-10-18  Micah Cowan  <micah@cowan.name>
 +
 +      * po/POTFILES.in: Removed no-longer-existing or generated files.
 +      * autogen.sh: Reinstated, in case we have to do something at
 +      some point other than autoreconf.
 +      * Makefile.am: Put autogen.sh back in EXTRA_DIST. Just in case
 +      someone needs to rebuild configure.
 +      * configure.ac: Removed config-post.h inclusion from bottom of
 +      generated config.h.
 +
 +2007-10-16  Micah Cowan  <micah@cowan.name>
 +
 +      * README: Draw attention to wiki:PatchGuidelines.
 +
 +2007-10-14  Micah Cowan  <micah@cowan.name>
 +
 +      * configure.ac: Let gnulib handle builtin MD5 functionality.
 +      * NEWS: Mention gnulib.
 +
 +2007-10-13  Micah Cowan  <micah@cowan.name>
 +
 +      * GNUMakefile, maint.mk: Added as part of the gnulib-ization.
 +      * Makefile.am: gnulib-ized.
 +      * configure.ac: gnulib-ized. Removed built-in getopt checks.
 +
 +2007-10-12  Micah Cowan  <micah@cowan.name>
 +
 +      * PATCHES: Removed.
 +      * NEWS: Updated info about source repositories, removal of
 +      PATCHES file.
 +
 +2007-10-09  Micah Cowan  <micah@cowan.name>
 +
 +      * configure.in: Renamed to configure.ac
 +      * configure.ac: Renamed from configure.in. Added invocations of
 +      AM_GNU_GETTEXT, etc. Added en@quot and en@boldquot pseudo-LINGUA
 +      support.
 +      * ABOUT-NLS: Added back in (required by autoreconf :\).
 +      * Makefile.am: Added ABOUT-NLS and msdos/Makefile.WC to EXTRA_DIST.
 +      * m4/wget.m4: Removed no-longer-used NLS stuff.
 +      * Makefile.in.in: Restore previous policy of not updating .po's
 +      unless explicitly asked (via update-po).
 +
 +2007-10-09  gettextize  <bug-gnu-gettext@gnu.org>
 +
 +      * m4/gettext.m4: New file, from gettext-0.16.1.
 +      * m4/iconv.m4: New file, from gettext-0.16.1.
 +      * m4/lib-ld.m4: Upgrade to gettext-0.16.1.
 +      * m4/lib-link.m4: Upgrade to gettext-0.16.1.
 +      * m4/lib-prefix.m4: Upgrade to gettext-0.16.1.
 +      * m4/nls.m4: New file, from gettext-0.16.1.
 +      * m4/po.m4: New file, from gettext-0.16.1.
 +      * m4/progtest.m4: New file, from gettext-0.16.1.
 +      * po/Makefile.in.in: Upgrade to gettext-0.16.1.
 +      * po/Rules-quot: New file, from gettext-0.16.1.
 +      * po/boldquot.sed: New file, from gettext-0.16.1.
 +      * po/en@boldquot.header: New file, from gettext-0.16.1.
 +      * po/en@quot.header: New file, from gettext-0.16.1.
 +      * po/insert-header.sin: New file, from gettext-0.16.1.
 +      * po/quot.sed: New file, from gettext-0.16.1.
 +      * po/remove-potcdate.sin: New file, from gettext-0.16.1.
 +
 +2007-10-08  Micah Cowan  <micah@cowan.name>
 +
 +      * AUTHORS: Credit to Ralf Wildenhues for automakifying patches.
 +
 +2007-10-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 +
 +      * po/Makefile.in.in: Since `distdir' is used now, adjust
 +      DISTFILES to the missing ChangeLog file.
 +      Add trivial targets ps, pdf, html.
 +      * Makefile.in: Removed, replaced by Makefile.am.
 +      * Makefile.am: Converted from Makefile.in.
 +      * util/Makefile.in: Removed, replaced by Makefile.am.
 +      * util/Makefile.am: Converted from Makefile.in.
 +      * configure.in: Adjust for automake support.
 +
  2007-10-05  Micah Cowan  <micah@cowan.name>
  
        * config.guess, config.sub, install-sh: Update from versions
        found in /usr/share/automake/.
 +      * autogen.sh: Removed, in favor of just running autoreconf.
  
  2007-10-03  Micah Cowan  <micah@cowan.name>
  
  2001-03-20  Dan Harkless  <wget@harkless.org>
  
        * TODO: Oops.  Hostless absolute link conversion _is_ working.  My
 -      test that led me to believe it wasn't was exposing a different bug
 -      -- URLs specified on the commandline as opposed to being recursed
 +      test that led me to believe it wasn't was exposing a different bug
 +      -- URLs specified on the commandline as opposed to being recursed
        to don't always get re-converted at the end of the Wget run.
  
  2001-03-17  Dan Harkless  <wget@harkless.org>
  2001-03-12  Dan Harkless  <wget@harkless.org>
  
        * TODO: Only normal recursion should respect -np -- page-requisite
 -      recursion should not.
 +      recursion should not.
  
  2001-03-07  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
  
  2001-03-01  Dan Harkless  <wget@harkless.org>
  
        * ChangeLog.README: Renamed from README.branches and added a note
 -      that Wget has multiple ChangeLog files (currently ./ChangeLog,
 -      doc/ChangeLog, and src/ChangeLog), since this is unusual and
 -      people have complained their patches hadn't been applied after
 -      checking only the top-level ChangeLog.
 +      that Wget has multiple ChangeLog files (currently ./ChangeLog,
 +      doc/ChangeLog, and src/ChangeLog), since this is unusual and
 +      people have complained their patches hadn't been applied after
 +      checking only the top-level ChangeLog.
  
  2001-02-28  Dan Harkless  <wget@harkless.org>
  
        moving -nr to a different category.
  
        * TODO: "Timestamps are sometimes not copied over on files
 -      retrieved by FTP." removed.  Hopefully all the failures I was
 -      seeing were due to the fact that it wasn't documented that
 -      non-globbing, non-recursive FTP downloads need -N to get the
 -      remote timestamp to be preserved.
 +      retrieved by FTP." removed.  Hopefully all the failures I was
 +      seeing were due to the fact that it wasn't documented that
 +      non-globbing, non-recursive FTP downloads need -N to get the
 +      remote timestamp to be preserved.
  
  2001-02-22  Dan Harkless  <wget@harkless.org>
  
  2001-01-11  Dan Harkless  <wget@harkless.org>
  
        * TODO: If -c used with -N, check to make sure a file hasn't
 -      changed on the server before "continuing" to download it.
 +      changed on the server before "continuing" to download it.
        
  2001-01-11  Adrian Aichner  <Adrian.Aichner@t-online.de>
  
        directory got fixed without the TODO entry for it being removed.
  
        * TODO: Add a "rollback" option to have --continue throw away X
 -      corrupted (e.g. by proxy) bytes from end of file before resuming.
 +      corrupted (e.g. by proxy) bytes from end of file before resuming.
  
        * po/*.po*: Updated after changing --help's description of -c.
  
        * README.branches: Explains the 1.6_branch.ChangeLog files.
  
        * README.cvs: Falsely claimed you only needed GNU autoconf to
 -      build from the CVS sources.  You also need GNU gettext and
 -      texinfo.  I also did a bunch of general re-writing of this file.
 +      build from the CVS sources.  You also need GNU gettext and
 +      texinfo.  I also did a bunch of general re-writing of this file.
  
  2001-01-03  Dan Harkless  <wget@harkless.org>
  
diff --combined Makefile.am
index f7a2c2215f9c66055acdb0d9f71c7cffbe0a9e7a,0000000000000000000000000000000000000000..e93a0b4fb44f1c86a6037278b65bb3f612b0ce7e
mode 100644,000000..100644
--- /dev/null
@@@ -1,45 -1,0 +1,46 @@@
- # In addition, as a special exception, the Free Software Foundation
- # gives permission to link the code of its release of Wget with the
- # OpenSSL project's "OpenSSL" library (or with modified versions of it
- # that use the same license as the "OpenSSL" library), and distribute
- # the linked executables.  You must obey the GNU General Public License
- # in all respects for all of the code used other than "OpenSSL".  If you
- # modify this file, you may extend this exception to your version of the
- # file, but you are not obligated to do so.  If you do not wish to do
- # so, delete this exception statement from your version.
 +# Makefile for `Wget' utility
 +# Copyright (C) 1995, 1996, 1997, 2006 Free Software Foundation, Inc.
 +# Copyright (C) 1995, 1996, 1997, 2006, 2007 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
 +# the Free Software Foundation; either version 3 of the License, or
 +# (at your option) any later version.
 +
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
 +
 +# You should have received a copy of the GNU General Public License
 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +
++# Additional permission under GNU GPL version 3 section 7
++
++# If you modify this program, or any covered work, by linking or
++# combining it with the OpenSSL project's OpenSSL library (or a
++# modified version of that library), containing parts covered by the
++# terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
++# grants you additional permission to convey the resulting work.
++# Corresponding Source for a non-source form of such a combination
++# shall include the source code for the parts of OpenSSL used as well
++# as that of the covered work.
 +
 +#
 +# Version: @VERSION@
 +#
 +
 +# Search for macros in the m4 subdirectory:
 +ACLOCAL_AMFLAGS = -I m4
 +
 +# subdirectories in the distribution
 +SUBDIRS = lib src doc po tests util windows
 +
 +test: all
 +      cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
 +
 +EXTRA_DIST = ChangeLog.README configure.bat MAILING-LIST \
 +           msdos/ChangeLog msdos/config.h msdos/Makefile.DJ \
 +           msdos/Makefile.WC ABOUT-NLS autogen.sh
 +
 +CLEANFILES = *~ *.bak $(DISTNAME).tar.gz
diff --combined README
index b062a49e8249ee7542960a93626a192f7c0dd475,be692876aa5e38c9c6f44f4e4bfab1f377a92376..2c668489af11248b918d86f80b794f32074e0d8e
--- 1/README
--- 2/README
+++ b/README
@@@ -52,9 -52,6 +52,9 @@@ Please report bugs in Wget to <bug-wget
  See the file `MAILING-LIST' for information about Wget mailing lists.
  Wget's home page is at <http://www.gnu.org/software/wget/>.
  
 +If you would like to contribute code for Wget, please read
 +http://wget.addictivecode.org/PatchGuidelines.
 +
  MAINTAINER: Micah Cowan <micah@cowan.name>
  
  Wget was originally written and mainained by Hrvoje Niksic.  Please see
@@@ -80,12 -77,13 +80,13 @@@ along with this program; if not, write 
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
  USA.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.
diff --combined configure.ac
index 4f65b7b151f47f2bae0b18a4eb25bbf69a8669b2,0000000000000000000000000000000000000000..9503ff6b7848a2bab760e6a803e5d3994decffd4
mode 100644,000000..100644
--- /dev/null
@@@ -1,461 -1,0 +1,462 @@@
- dnl In addition, as a special exception, the Free Software Foundation
- dnl gives permission to link the code of its release of Wget with the
- dnl OpenSSL project's "OpenSSL" library (or with modified versions of it
- dnl that use the same license as the "OpenSSL" library), and distribute
- dnl the linked executables.  You must obey the GNU General Public License
- dnl in all respects for all of the code used other than "OpenSSL".  If you
- dnl modify this file, you may extend this exception to your version of the
- dnl file, but you are not obligated to do so.  If you do not wish to do
- dnl so, delete this exception statement from your version.
 +dnl Template file for GNU Autoconf
 +dnl Copyright (C) 1995, 1996, 1997, 2001, 2007 Free Software Foundation, Inc.
 +
 +dnl This program is free software; you can redistribute it and/or modify
 +dnl it under the terms of the GNU General Public License as published by
 +dnl the Free Software Foundation; either version 3 of the License, or
 +dnl (at your option) any later version.
 +
 +dnl This program is distributed in the hope that it will be useful,
 +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
 +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +dnl GNU General Public License for more details.
 +
 +dnl You should have received a copy of the GNU General Public License
 +dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +
++dnl Additional permission under GNU GPL version 3 section 7
++
++dnl If you modify this program, or any covered work, by linking or
++dnl combining it with the OpenSSL project's OpenSSL library (or a
++dnl modified version of that library), containing parts covered by the
++dnl terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
++dnl grants you additional permission to convey the resulting work.
++dnl Corresponding Source for a non-source form of such a combination
++dnl shall include the source code for the parts of OpenSSL used as well
++dnl as that of the covered work.
 +
 +dnl
 +dnl Process this file with autoconf to produce a configure script.
 +dnl
 +
 +AC_INIT([wget], 
 +      [1.12-devel],
 +      [bug-wget@gnu.org])
 +AC_PREREQ(2.61)
 +
 +dnl
 +dnl What version of Wget are we building?
 +dnl
 +AC_MSG_NOTICE([configuring for GNU Wget $PACKAGE_VERSION])
 +
 +AC_CONFIG_MACRO_DIR([m4])
 +AC_CONFIG_AUX_DIR([.])
 +
 +dnl
 +dnl Automake setup
 +dnl
 +AM_INIT_AUTOMAKE(1.9)
 +
 +dnl
 +dnl Gettext
 +dnl
 +AM_GNU_GETTEXT([external],[need-ngettext])
 +AM_GNU_GETTEXT_VERSION([0.16.1])
 +
 +dnl
 +dnl Get cannonical host
 +dnl
 +AC_CANONICAL_HOST
 +AC_DEFINE_UNQUOTED([OS_TYPE], "$host_os",
 +                   [Define to be the name of the operating system.])
 +
 +dnl
 +dnl Process features.
 +dnl
 +
 +AC_ARG_WITH(ssl,
 +[[  --without-ssl           disable SSL autodetection]])
 +
 +AC_ARG_ENABLE(opie,
 +[  --disable-opie          disable support for opie or s/key FTP login],
 +ENABLE_OPIE=$enableval, ENABLE_OPIE=yes)
 +test x"${ENABLE_OPIE}" = xyes && AC_DEFINE([ENABLE_OPIE], 1,
 +   [Define if you want the Opie support for FTP compiled in.])
 +
 +AC_ARG_ENABLE(digest,
 +[  --disable-digest        disable support for HTTP digest authorization],
 +ENABLE_DIGEST=$enableval, ENABLE_DIGEST=yes)
 +test x"${ENABLE_DIGEST}" = xyes && AC_DEFINE([ENABLE_DIGEST], 1,
 +   [Define if you want the HTTP Digest Authorization compiled in.])
 +
 +AC_ARG_ENABLE(ntlm,
 +[  --disable-ntlm          disable support for NTLM authorization],
 +[ENABLE_NTLM=$enableval], [ENABLE_NTLM=auto])
 +
 +AC_ARG_ENABLE(debug,
 +[  --disable-debug         disable support for debugging output],
 +ENABLE_DEBUG=$enableval, ENABLE_DEBUG=yes)
 +test x"${ENABLE_DEBUG}" = xyes && AC_DEFINE([ENABLE_DEBUG], 1,
 +   [Define if you want the debug output support compiled in.])
 +
 +wget_need_md5=no
 +
 +case "${ENABLE_OPIE}${ENABLE_DIGEST}" in
 +*yes*)
 +      wget_need_md5=yes
 +esac
 +
 +dnl
 +dnl Find the compiler
 +dnl
 +
 +dnl We want these before the checks, so the checks can modify their values.
 +test -z "$CFLAGS"  && CFLAGS= auto_cflags=1
 +test -z "$CC" && cc_specified=yes
 +
 +AC_PROG_CC
 +AM_PROG_CC_C_O
 +AC_AIX
 +gl_EARLY
 +
 +AC_PROG_RANLIB
 +
 +dnl Turn on optimization by default.  Specifically:
 +dnl
 +dnl if the user hasn't specified CFLAGS, then
 +dnl   if compiler is gcc, then
 +dnl     use -O2 and some warning flags
 +dnl   else
 +dnl     use os-specific flags or -O
 +if test -n "$auto_cflags"; then
 +  if test -n "$GCC"; then
 +    CFLAGS="$CFLAGS -O2 -Wall"
 +  else
 +    case "$host_os" in
 +      *hpux*)  CFLAGS="$CFLAGS +O3"                      ;;
 +      *ultrix* | *osf*) CFLAGS="$CFLAGS -O -Olimit 2000" ;;
 +      *)       CFLAGS="$CFLAGS -O" ;;
 +    esac
 +  fi
 +fi
 +
 +dnl
 +dnl Checks for basic compiler characteristics.
 +dnl
 +AC_C_CONST
 +AC_C_INLINE
 +AC_C_VOLATILE
 +
 +dnl Check for basic headers, even though we expect them to exist and
 +dnl #include them unconditionally in the code.  Their detection is
 +dnl still needed because test programs used by Autoconf macros check
 +dnl for STDC_HEADERS, HAVE_SYS_TYPES_H, etc. before using them.
 +dnl Without the checks they will fail to be included in test programs,
 +dnl which will subsequently fail.
 +AC_HEADER_STDC
 +
 +dnl Check for large file support.  This check needs to come fairly
 +dnl early because it could (in principle) affect whether functions and
 +dnl headers are available, whether they work, etc.
 +AC_SYS_LARGEFILE
 +AC_CHECK_SIZEOF(off_t)
 +
 +dnl
 +dnl Checks for system header files that might be missing.
 +dnl
 +AC_HEADER_STDBOOL
 +AC_CHECK_HEADERS(unistd.h sys/time.h)
 +AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/select.h utime.h sys/utime.h)
 +AC_CHECK_HEADERS(stdint.h inttypes.h pwd.h)
 +
 +dnl
 +dnl Check sizes of integer types.  These are used to find n-bit
 +dnl integral types on older systems that fail to provide intN_t and
 +dnl uintN_t typedefs.
 +dnl
 +AC_CHECK_SIZEOF(short)
 +AC_CHECK_SIZEOF(int)
 +AC_CHECK_SIZEOF(long)
 +AC_CHECK_SIZEOF(long long)
 +AC_CHECK_SIZEOF(void *)
 +
 +dnl
 +dnl Checks for non-universal or system-specific types.
 +dnl
 +AC_TYPE_SIZE_T
 +AC_TYPE_PID_T
 +AC_CHECK_TYPES([uint32_t, uintptr_t, intptr_t, int64_t])
 +AC_CHECK_TYPES(sig_atomic_t, [], [], [
 +#include <stdio.h>
 +#include <sys/types.h>
 +#if HAVE_INTTYPES_H
 +# include <inttypes.h>
 +#endif
 +#include <signal.h>
 +])
 +
 +# gnulib
 +gl_INIT
 +
 +dnl
 +dnl Checks for library functions.
 +dnl
 +AC_FUNC_ALLOCA
 +AC_FUNC_MMAP
 +AC_FUNC_FSEEKO
 +AC_CHECK_FUNCS(strptime timegm snprintf vsnprintf vasprintf drand48)
 +AC_CHECK_FUNCS(strtoll usleep ftello sigblock sigsetjmp memrchr)
 +
 +if test x"$ENABLE_OPIE" = xyes; then
 +  AC_LIBOBJ([ftp-opie])
 +fi
 +
 +dnl We expect to have these functions on Unix-like systems configure
 +dnl runs on.  The defines are provided to get them in config.h.in so
 +dnl Wget can still be ported to non-Unix systems (such as Windows)
 +dnl that lack some of these functions.
 +AC_DEFINE([HAVE_STRCASECMP], 1, [Define to 1 if you have the `strcasecmp' function.])
 +AC_DEFINE([HAVE_STRNCASECMP], 1, [Define to 1 if you have the `strncasecmp' function.])
 +AC_DEFINE([HAVE_STRDUP], 1, [Define to 1 if you have the `strdup' function.])
 +AC_DEFINE([HAVE_ISATTY], 1, [Define to 1 if you have the `isatty' function.])
 +AC_DEFINE([HAVE_SYMLINK], 1, [Define to 1 if you have the `symlink' function.])
 +
 +dnl
 +dnl Call Wget-specific macros defined in aclocal.
 +dnl
 +WGET_STRUCT_UTIMBUF
 +WGET_SOCKLEN_T
 +WGET_FNMATCH
 +WGET_NANOSLEEP
 +WGET_POSIX_CLOCK
 +WGET_NSL_SOCKET
 +
 +dnl
 +dnl Checks for libraries.
 +dnl
 +
 +AS_IF([test x"$with_ssl" = xgnutls], [
 +  dnl Now actually check for -lssl
 +  AC_LIB_HAVE_LINKFLAGS([gnutls], [], [
 +#include <gnutls/gnutls.h>
 +  ], [gnutls_global_init()])
 +  if test x"$LIBGNUTLS" != x
 +  then
 +    AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
 +    AC_LIBOBJ([gnutls])
 +  else
 +    AC_MSG_ERROR([--with-ssl=gnutls was given, but GNUTLS is not available.])
 +  fi
 +], [
 +  # --with-ssl is not gnutls: check if it's no
 +  AS_IF([test x"$with_ssl" != xno], [
 +    dnl As of this writing (OpenSSL 0.9.6), the libcrypto shared library
 +    dnl doesn't record its dependency on libdl, so we need to make sure
 +    dnl -ldl ends up in LIBS on systems that have it.  Most OSes use
 +    dnl dlopen(), but HP-UX uses shl_load().
 +    AC_CHECK_LIB(dl, dlopen, [], [
 +      AC_CHECK_LIB(dl, shl_load)
 +    ])
 +
 +    dnl Now actually check for -lssl
 +    AC_LIB_HAVE_LINKFLAGS([ssl], [crypto], [
 +  #include <openssl/ssl.h>
 +  #include <openssl/x509.h>
 +  #include <openssl/err.h>
 +  #include <openssl/rand.h>
 +  #include <openssl/des.h>
 +  #include <openssl/md4.h>
 +  #include <openssl/md5.h>
 +    ], [SSL_library_init ()])
 +    if test x"$LIBSSL" != x
 +    then
 +      AC_MSG_NOTICE([compiling in support for SSL via OpenSSL])
 +      AC_LIBOBJ([openssl])
 +    elif test x"$with_ssl" != x
 +    then
 +      AC_MSG_ERROR([--with-ssl was given, but SSL is not available.])
 +    fi
 +  ]) # endif: --with-ssl == no?
 +]) # endif: --with-ssl == gnutls?
 +
 +
 +dnl Enable NTLM if requested and if SSL is available.
 +if test x"$LIBSSL" != x
 +then
 +  if test x"$ENABLE_NTLM" != xno
 +  then
 +    AC_DEFINE([ENABLE_NTLM], 1,
 +     [Define if you want the NTLM authorization support compiled in.])
 +    AC_LIBOBJ([http-ntlm])
 +  fi
 +else
 +  dnl If SSL is unavailable and the user explicitly requested NTLM,
 +  dnl abort.
 +  if test x"$ENABLE_NTLM" = xyes
 +  then
 +    AC_MSG_ERROR([NTLM authorization requested and OpenSSL not found; aborting])
 +  fi
 +fi
 +
 +dnl
 +dnl Find an MD5 implementation.  Since Wget rarely needs MD5, we try
 +dnl to use an existing library implementation to save on code size.
 +dnl
 +
 +if test x"$wget_need_md5" = xyes
 +then
 +  dnl This should be moved to an AC_DEFUN, but I'm not sure how to
 +  dnl manipulate MD5_OBJ from the defun.
 +
 +  AC_LIBOBJ([gen-md5])
 +  found_md5=no
 +
 +  dnl Check for the system MD5 library on Solaris.  We don't check for
 +  dnl something simple like "MD5Update" because there are a number of
 +  dnl MD5 implementations that use that name, but have an otherwise
 +  dnl incompatible interface.  md5_calc is, hopefully, specific to the
 +  dnl Solaris MD5 library.
 +  if test x"$found_md5" = xno; then
 +    AC_CHECK_LIB(md5, md5_calc, [
 +      dnl Some installations have bogus <md5.h> in the compiler's
 +      dnl include path, making the system md5 library useless.
 +      AC_MSG_CHECKING([for working md5.h])
 +      AC_COMPILE_IFELSE([#include <md5.h>
 +                        ], [
 +        AC_MSG_RESULT(yes)
 +        AC_DEFINE([HAVE_SOLARIS_MD5], 1, [Define when using Solaris MD5.])
 +        LIBS="-lmd5 $LIBS"
 +        found_md5=yes
 +        AC_MSG_NOTICE([using the Solaris MD5 implementation])
 +      ], [AC_MSG_RESULT(no)])
 +    ])
 +  fi
 +
 +  dnl Then see if we're linking OpenSSL anyway; if yes, use its md5
 +  dnl implementation.
 +  if test x"$found_md5" = xno; then
 +    if test x"$LIBSSL" != x; then
 +      AC_DEFINE([HAVE_OPENSSL_MD5], 1, [Define when using OpenSSL MD5.])
 +      found_md5=yes
 +      AC_MSG_NOTICE([using the OpenSSL MD5 implementation])
 +    fi
 +  fi
 +
 +  dnl If none of the above worked, use the one we ship with Wget.
 +  if test x"$found_md5" = xno; then
 +    AC_DEFINE([HAVE_BUILTIN_MD5], 1, [Define when using built-in MD5.])
 +    found_md5=yes
 +    AC_MSG_NOTICE([using the built-in (GNU) MD5 implementation])
 +    AC_C_BIGENDIAN
 +  fi
 +fi
 +AC_DEFINE([HAVE_MD5], 1, [Define if we're compiling support for MD5.])
 +
 +dnl **********************************************************************
 +dnl Checks for IPv6
 +dnl **********************************************************************
 +
 +dnl
 +dnl We test for IPv6 by checking, in turn, for availability of
 +dnl getaddrinfo, presence of the INET6 address/protocol family, and
 +dnl the existence of struct sockaddr_in6.  If any of them is missing,
 +dnl IPv6 is disabled, and the code reverts to old-style gethostbyname.
 +dnl
 +dnl If --enable-ipv6 is explicitly specified on the configure command
 +dnl line, we check for IPv6 and abort if not found.  If --disable-ipv6
 +dnl is specified, we disable IPv6 and don't check for it.  The default
 +dnl is to autodetect IPv6 and use it where available.
 +dnl
 +
 +AC_ARG_ENABLE(ipv6,
 +  AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
 +  [case "${enable_ipv6}" in
 +    no)
 +      AC_MSG_NOTICE([disabling IPv6 at user request])
 +      dnl Disable IPv6 checking
 +      ipv6=no
 +      ;;
 +    yes)
 +      dnl IPv6 explicitly enabled: force its use (abort if unavailable).
 +      ipv6=yes
 +      force_ipv6=yes
 +      ;;
 +    auto)
 +      dnl Auto-detect IPv6, i.e. check for IPv6, but don't force it.
 +      ipv6=yes
 +      ;;
 +    *)
 +      AC_MSG_ERROR([Invalid --enable-ipv6 argument \`$enable_ipv6'])
 +      ;;
 +    esac
 +  ], [
 +    dnl If nothing is specified, assume auto-detection.
 +    ipv6=yes
 +  ]
 +)
 +
 +if test "X$ipv6" = "Xyes"; then
 +  AC_CHECK_FUNCS(getaddrinfo, [], [
 +    AC_MSG_NOTICE([Disabling IPv6 support: your system does not support getaddrinfo(3)])
 +    ipv6=no
 +  ])
 +fi
 +
 +if test "X$ipv6" = "Xyes"; then
 +  PROTO_INET6([], [
 +    AC_MSG_NOTICE([Disabling IPv6 support: your system does not support the PF_INET6 protocol family])
 +    ipv6=no
 +  ])
 +fi
 +
 +if test "X$ipv6" = "Xyes"; then
 +  TYPE_STRUCT_SOCKADDR_IN6([],[
 +    AC_MSG_NOTICE([Disabling IPv6 support: your system does not support \`struct sockaddr_in6'])
 +    ipv6=no
 +  ])
 +  if test "X$ipv6" = "Xyes"; then
 +    WGET_STRUCT_SOCKADDR_STORAGE
 +    MEMBER_SIN6_SCOPE_ID
 +  fi
 +fi
 +
 +if test "X$ipv6" = "Xyes"; then
 +  AC_DEFINE([ENABLE_IPV6], 1, [Define if IPv6 support is enabled.])
 +  AC_MSG_NOTICE([Enabling support for IPv6.])
 +elif test "x$force_ipv6" = "xyes"; then
 +  AC_MSG_ERROR([IPv6 support requested but not found; aborting])
 +fi
 +
 +
 +dnl
 +dnl Set of available languages.
 +dnl
 +dnl Originally this used to be static, looking like this:
 +dnl     ALL_LINGUAS="cs de hr it ..."
 +dnl The downside was that configure needed to be rebuilt whenever a
 +dnl new language was added.
 +dnl
 +ALL_LINGUAS="en@quot en@boldquot $(cd ${srcdir}/po && ls *.po | grep -v 'en@.*quot' | sed -e 's/\.po$//' | tr '\012' ' ')"
 +
 +dnl
 +dnl Find makeinfo.  We used to provide support for Emacs processing
 +dnl Texinfo using `emacs -batch -eval ...' where makeinfo is
 +dnl unavailable, but that broke with the addition of makeinfo-specific
 +dnl command-line options, such as `-I'.  Now we depend on makeinfo to
 +dnl build the Info documentation.
 +dnl
 +
 +AC_CHECK_PROGS(MAKEINFO, [makeinfo], [true])
 +
 +dnl
 +dnl Find perl and pod2man
 +dnl
 +
 +AC_PATH_PROGS(PERL, [perl5 perl], no)
 +AC_PATH_PROG(POD2MAN, pod2man, no)
 +
 +if test "x${POD2MAN}" = xno; then
 +  COMMENT_IF_NO_POD2MAN="# "
 +else
 +  COMMENT_IF_NO_POD2MAN=
 +fi
 +AC_SUBST(COMMENT_IF_NO_POD2MAN)
 +
 +dnl
 +dnl Create output
 +dnl
 +AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile util/Makefile
 +                 po/Makefile.in tests/Makefile tests/WgetTest.pm
 +                 lib/Makefile windows/Makefile])
 +AC_CONFIG_HEADERS([src/config.h])
 +AC_OUTPUT
diff --combined m4/wget.m4
index 67cc294290a44162139bdbb32901666178708f88,ba06de93439825125a71269f6e4d9200571b89f8..c08cec97401b1bba548f9f6bc59845c31bbb91ef
@@@ -15,15 -15,16 +15,16 @@@ dnl GNU General Public License for mor
  dnl You should have received a copy of the GNU General Public License
  dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
  
- dnl In addition, as a special exception, the Free Software Foundation
- dnl gives permission to link the code of its release of Wget with the
- dnl OpenSSL project's "OpenSSL" library (or with modified versions of it
- dnl that use the same license as the "OpenSSL" library), and distribute
- dnl the linked executables.  You must obey the GNU General Public License
- dnl in all respects for all of the code used other than "OpenSSL".  If you
- dnl modify this file, you may extend this exception to your version of the
- dnl file, but you are not obligated to do so.  If you do not wish to do
- dnl so, delete this exception statement from your version.
+ dnl Additional permission under GNU GPL version 3 section 7
+ dnl If you modify this program, or any covered work, by linking or
+ dnl combining it with the OpenSSL project's OpenSSL library (or a
+ dnl modified version of that library), containing parts covered by the
+ dnl terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ dnl grants you additional permission to convey the resulting work.
+ dnl Corresponding Source for a non-source form of such a combination
+ dnl shall include the source code for the parts of OpenSSL used as well
+ dnl as that of the covered work.
  
  dnl
  dnl Check for `struct utimbuf'.
@@@ -226,6 -227,145 +227,6 @@@ dnl ***********************************
  dnl END OF IPv6 AUTOCONFIGURATION SUPPORT MACROS
  dnl ************************************************************
  \f
 -# This code originates from Ulrich Drepper's AM_WITH_NLS.
 -
 -AC_DEFUN([WGET_WITH_NLS],
 -  [AC_MSG_CHECKING([whether NLS is requested])
 -    dnl Default is enabled NLS
 -    AC_ARG_ENABLE(nls,
 -      [  --disable-nls           do not use Native Language Support],
 -      HAVE_NLS=$enableval, HAVE_NLS=yes)
 -    AC_MSG_RESULT($HAVE_NLS)
 -
 -    dnl If something goes wrong, we may still decide not to use NLS.
 -    dnl For this reason, defer AC_SUBST'ing HAVE_NLS until the very
 -    dnl last moment.
 -
 -    if test x"$HAVE_NLS" = xyes; then
 -      dnl If LINGUAS is specified, use only those languages.  In fact,
 -      dnl compute an intersection of languages in LINGUAS and
 -      dnl ALL_LINGUAS, and use that.
 -      if test x"$LINGUAS" != x; then
 -        new_linguas=
 -        for lang1 in $ALL_LINGUAS; do
 -          for lang2 in $LINGUAS; do
 -            if test "$lang1" = "$lang2"; then
 -              new_linguas="$new_linguas $lang1"
 -            fi
 -          done
 -        done
 -        ALL_LINGUAS=$new_linguas
 -      fi
 -      AC_MSG_NOTICE([language catalogs: $ALL_LINGUAS])
 -      AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 -      [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
 -      AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 -        [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 -      AC_SUBST(MSGFMT)
 -      AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 -      CATOBJEXT=.gmo
 -      INSTOBJEXT=.mo
 -      DATADIRNAME=share
 -
 -      dnl Test whether we really found GNU xgettext.
 -      if test "$XGETTEXT" != ":"; then
 -      dnl If it is no GNU xgettext we define it as : so that the
 -      dnl Makefiles still can work.
 -      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 -        : ;
 -      else
 -        AC_MSG_RESULT(
 -          [found xgettext programs is not GNU xgettext; ignore it])
 -        XGETTEXT=":"
 -      fi
 -      fi
 -
 -      AC_CHECK_HEADERS(libintl.h)
 -
 -      dnl Prefer gettext found in -lintl to the one in libc.
 -      dnl Otherwise it can happen that we include libintl.h from
 -      dnl /usr/local/lib, but fail to specify -lintl, which results in
 -      dnl link or run-time failures.  (Symptom: libintl_bindtextdomain
 -      dnl not found at link-time.)
 -
 -      AC_CHECK_LIB(intl, gettext, [
 -        dnl gettext is in libintl; announce the fact manually.
 -        LIBS="-lintl $LIBS"
 -      AC_DEFINE([HAVE_GETTEXT], 1,
 -                  [Define if you have the gettext function.])
 -      ], [
 -        AC_CHECK_FUNCS(gettext, [], [
 -          AC_MSG_RESULT([gettext not found; disabling NLS])
 -          HAVE_NLS=no
 -        ])
 -      ])
 -
 -      for lang in $ALL_LINGUAS; do
 -      GMOFILES="$GMOFILES $lang.gmo"
 -      POFILES="$POFILES $lang.po"
 -      done
 -      dnl Construct list of names of catalog files to be constructed.
 -      for lang in $ALL_LINGUAS; do
 -        CATALOGS="$CATALOGS ${lang}${CATOBJEXT}"
 -      done
 -
 -      dnl Make all variables we use known to autoconf.
 -      AC_SUBST(CATALOGS)
 -      AC_SUBST(CATOBJEXT)
 -      AC_SUBST(DATADIRNAME)
 -      AC_SUBST(GMOFILES)
 -      AC_SUBST(INSTOBJEXT)
 -      AC_SUBST(INTLLIBS)
 -      AC_SUBST(POFILES)
 -    fi
 -    AC_SUBST(HAVE_NLS)
 -    dnl Some independently maintained files, such as po/Makefile.in,
 -    dnl use `USE_NLS', so support it.
 -    USE_NLS=$HAVE_NLS
 -    AC_SUBST(USE_NLS)
 -    if test "x$HAVE_NLS" = xyes; then
 -      AC_DEFINE([HAVE_NLS], 1, [Define this if you want the NLS support.])
 -    fi
 -  ])
 -
 -dnl Generate list of files to be processed by xgettext which will
 -dnl be included in po/Makefile.
 -dnl
 -dnl This is not strictly an Autoconf macro, because it is run from
 -dnl within `config.status' rather than from within configure.  This
 -dnl is why special rules must be applied for it.
 -AC_DEFUN([WGET_PROCESS_PO],
 -  [
 -   dnl I wonder what the following several lines do...
 -   if test "x$srcdir" != "x."; then
 -     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
 -       posrcprefix="$srcdir/"
 -     else
 -       posrcprefix="../$srcdir/"
 -     fi
 -   else
 -     posrcprefix="../"
 -   fi
 -   rm -f po/POTFILES
 -   dnl Use `echo' rather than AC_MSG_RESULT, because this is run from
 -   dnl `config.status'.
 -   echo "generating po/POTFILES from $srcdir/po/POTFILES.in"
 -   sed -e "/^#/d" -e "/^\$/d" -e "s,.*,       $posrcprefix& \\\\,"  \
 -       -e "\$s/\(.*\) \\\\/\1/" \
 -        < $srcdir/po/POTFILES.in > po/POTFILES
 -   echo "creating po/Makefile"
 -   sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
 -  ])
 -
 -# Search path for a program which passes the given test.
 -# Ulrich Drepper <drepper@cygnus.com>, 1996.
 -#
 -# This file may be copied and used freely without restrictions.  It
 -# can be used in projects which are not available under the GNU Public
 -# License but which still want to provide support for the GNU gettext
 -# functionality.  Please note that the actual code is *not* freely
 -# available.
 -
  dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
  dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  AC_DEFUN([AM_PATH_PROG_WITH_TEST],
diff --combined msdos/ChangeLog
index 1036c296c518c895841f2078c4b9a6d408932935,63881d06a2becc0c46c93bf72ac31e112a8cfcbd..552dec070f535fb813749f5fc92474b97252c70c
@@@ -1,24 -1,7 +1,28 @@@
+ 2007-11-28  Micah Cowan <micah@cowan.name>
+       * config.h: Updated license exception for OpenSSL, per the SFLC.
 +2007-10-15  Gisle Vanem  <gvanem@broadpark.no>
 +
 +      * config.h: Added some HAVE_* for djgpp 2.04 and Watcom 1.7+.
 +
 +      * Makefile.DJ: rewritten for including some files from ../lib.
 +
 +      * Makefile.WC: Ditto. Handling source-files out-of current
 +      directory makes compliation a bit more painfull. AFAICS, one
 +      must use explicit rules.
 +
 +2007-10-02  Gisle Vanem  <gvanem@broadpark.no>
 +
 +      * config.h: Removed unused defines, added needed 'HAVE_*' defines.
 +
 +      * Makefile.DJ: rewritten to be used from './src' directory.
 +      Added '-DOPENSSL_NO_KRB5' for OpenSSL build. Target is
 +      now wget.exe.
 +
 +      * Makefile.WC: Added for building with OpenWatcom targeting
 +      32-bit DOS (DOS32A extender). 
 +
  2007-09-24  Gisle Vanem  <giva@bgnett.no>
  
        * Makefile.DJ, config.h: Added to support building on MS-DOS via
diff --combined msdos/config.h
index f40eb45cb80b30fea5cb155cd9ef3b1bbef52a1d,a3e9c1c6f602554bb2bed741f6d4c39ae17f3750..25a6df83228f9c0eb851c27c61e94ee3ab8e72e6
     You should have received a copy of the GNU General Public License
     along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
-    In addition, as a special exception, the Free Software Foundation
-    gives permission to link the code of its release of Wget with the
-    OpenSSL project's "OpenSSL" library (or with modified versions of it
-    that use the same license as the "OpenSSL" library), and distribute
-    the linked executables.  You must obey the GNU General Public License
-    in all respects for all of the code used other than "OpenSSL".  If you
-    modify this file, you may extend this exception to your version of the
-    file, but you are not obligated to do so.  If you do not wish to do
-    so, delete this exception statement from your version.  */
+    Additional permission under GNU GPL version 3 section 7
+    If you modify this program, or any covered work, by linking or
+    combining it with the OpenSSL project's OpenSSL library (or a
+    modified version of that library), containing parts covered by the
+    terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+    grants you additional permission to convey the resulting work.
+    Corresponding Source for a non-source form of such a combination
+    shall include the source code for the parts of OpenSSL used as well
+    as that of the covered work.  */
  
  
  #ifndef CONFIG_DOS_H
  
  #include <sys/errno.h>
  
 -#if defined(__WATCOMC__) && (__WATCOMC__ >= 1250)  /* OW 1.5+ */
 +#if defined(__WATCOMC__)
 +  #if (__WATCOMC__ >= 1250)  /* OW 1.5+ */
    #define OPENWATCOM_15
 +  #endif
 +  #if (__WATCOMC__ >= 1270)  /* OW 1.7+ */
 +    #define OPENWATCOM_17
 +  #endif
  #endif
  
  #if defined(__HIGHC__)
 -  #define inline
    #define HAVE_UNISTD_H 1
    #define HAVE_UTIME_H 1
  #endif
  
 -#if defined(__WATCOMC__) || defined(__BORLANDC__)
 +#if defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__HIGHC__)
    #define inline
  #endif
  
 -#ifdef HAVE_SSL
 -  #define OPENSSL_NO_KRB5
 -#endif
 -
 -#define STDC_HEADERS 1
 -#define RETSIGTYPE void
 -
  #define USE_OPIE 1
  #define USE_DIGEST 1
  #define DEBUG
  
  #ifdef __DJGPP__
 -  #define HAVE_STRUCT_UTIMBUF 1
 -  #define HAVE_UNAME 1
 -  #define HAVE_UTIME_H 1
 +  #define HAVE__BOOL          1
    #define HAVE_STRCASECMP 1
    #define HAVE_STRNCASECMP 1
 -  #define HAVE_SYS_SELECT_H 1
 -  #define HAVE_USLEEP 1
 -  #define HAVE_SIGNAL 1
 -  #define HAVE_BASENAME 1
    #define HAVE_SIGSETJMP 1
    #define HAVE_SIGBLOCK 1
 -  #define HAVE__BOOL 1
 +  #define HAVE_STRUCT_UTIMBUF 1
 +  #define HAVE_SYS_SELECT_H   1
 +  #define HAVE_USLEEP         1
 +  #define HAVE_UTIME_H        1
 +  #define HAVE_INT64_T        1
  
    #if (DJGPP_MINOR >= 4)
 -    #include <stdbool.h>
 +    #define HAVE_STDBOOL_H 1
 +    #define HAVE_STDINT_H  1
      #define HAVE_SNPRINTF 1
      #define HAVE_VSNPRINTF 1
      #define HAVE_UINT32_T 1
  #endif
  
  #ifdef OPENWATCOM_15
 -  #define HAVE_STRCASECMP
 -  #define HAVE_STRNCASECMP
 +  #define HAVE_INT64_T     1
 +  #define HAVE_SNPRINTF    1
 +  #define HAVE_STRCASECMP  1
 +  #define HAVE_STRNCASECMP 1
 +  #define HAVE_STDINT_H    1
 +  #define HAVE_UTIME_H     1
 +#endif
 +
 +#ifdef OPENWATCOM_17
 +  #define HAVE__BOOL       1
 +  #define HAVE_STDBOOL_H   1
  #endif
  
 -#define HAVE_GETHOSTBYNAME 1
 -#define HAVE_GETHOSTNAME 1
 -#define HAVE_SELECT 1
 +#define HAVE_PROCESS_H     1
  #define HAVE_STRDUP 1
 -#define HAVE_STRERROR 1
 -#define HAVE_STRSTR 1
 -#define HAVE_MKTIME 1
 -#define HAVE_STDARG_H 1
  #define HAVE_STDLIB_H 1
  #define HAVE_STRING_H 1
 -#define HAVE_SIGNAL_H 1
 -#define HAVE_GETTIMEOFDAY 1
 -#define HAVE_MD5 1
  #define HAVE_BUILTIN_MD5 1
  #define HAVE_ISATTY 1
 -#define HAVE_MEMMOVE 1
 -
 -#define OS_TYPE "DOS"
 -#define CTRLBREAK_BACKGND 1
 -#define PROTOTYPES 1
 -
 -#define WGET_USE_STDARG
  
  #define lookup_host  wget_lookuphost
  #define select       select_s
  #define sock_write   wget_sock_write
  #define sock_close   wget_sock_close
  
 -#if defined(__DJGPP__)
 -  #define MKDIR(p,a) mkdir(p,a)
 -#else
 +#if !defined(__DJGPP__)
 +  #include <direct.h>
 +  #define mkdir(p,a)  (mkdir)(p)
    #define strcasecmp stricmp
 -  #define MKDIR(p,a) mkdir(p)
  #endif
  
  #if !defined(MSDOS)
 -#define MSDOS
 +  #define MSDOS
  #endif
  
 +#define OS_TYPE "DOS"
 +
  #endif  /* CONFIG_DOS_H */
diff --combined src/ChangeLog
index 826a02b402d2af00bd6a41310ad3c673836dc991,bb62713a3624ed339cf01d7a935f7907e4c2940d..1c02c9ce354549c68a61eb0cadfd84e155c91cab
 -      * Makefile.in, cmpt.c, connect.c, connect.h, convert.c,
+ 2007-11-28  Micah Cowan  <micah@cowan.name>
++      * Makefile.am, cmpt.c, connect.c, connect.h, convert.c,
+       convert.h, cookies.c, cookies.h, ftp-basic.c, ftp-ls.c,
+       ftp-opie.c, ftp.c, ftp.h, gen-md5.c, gen-md5.h, gnutls.c,
+       hash.c, hash.h, host.c, host.h, html-parse.c, html-parse.h,
+       html-url.c, http-ntlm.c, http-ntlm.h, http.c, http.h, init.c,
+       init.h, log.c, log.h, main.c, mswindows.c, mswindows.h,
+       netrc.c, netrc.h, openssl.c, options.h, progress.c, progress.h,
+       ptimer.c, ptimer.h, recur.c, recur.h, res.c, res.h, retr.c,
+       retr.h, safe-ctype.c, safe-ctype.h, spider.c, spider.h, ssl.h,
+       sysdep.h, test.c, test.h, url.c, url.h, utils.c, utils.h,
+       wget.h, xmalloc.c, xmalloc.h: Updated license exception for
+       OpenSSL, per the SFLC.
 +2007-10-30  Micah Cowan  <micah@cowan.name>
 +
 +      * main.c (main): Declare argv parameter as char **argv, rather
 +      than char *const *argv. This fixes usage of getopt_long,
 +      regardless of whether getopt_long has a constified argv or not.
 +
 +2007-10-22  Gisle Vanem  <gvanem@broadpark.no>
 +
 +      * mswindows.c: Move INHIBIT_WRAP macro definition up with wget.h
 +      inclusion.
 +
 +2007-10-18  Steven Schweda  <sms@antinode.org>
 +
 +      * sysdep.h: #include <stdint.h> as well as <inttypes.h>, to work
 +      around a glitch on Tru64 systems.
 +
 +2007-10-18  Micah Cowan  <micah@cowan.name>
 +
 +      * Makefile.am: version.c should not be distributed. Removed
 +      config-post.h. Add version.c dependency and gnulib include path
 +      for libunittest.a.
 +      * sysdep.h: Got contents of config-post.h
 +      * config-post.h: Removed.
 +      * wget.h: #include "config.h".
 +      * alloca.c, cmpt.c, connect.c, convert.c, cookies.c,
 +      ftp-basic.c, ftp-ls.c, ftp-opie.c, ftp.c, gen-md5.c, gnutls.c,
 +      hash.c, host.c, html-parse.c, html-url.c, http-ntlm.c, http.c,
 +      init.c, log.c, main.c, mswindows.c, netrc.c, openssl.c,
 +      progress.c, ptimer.c, recur.c, res.c, retr.c, spider.c, url.c,
 +      utils.c, xmalloc.c: Use wget.h at very top, and instead of
 +      config.h.
 +
 +2007-10-15  Micah Cowan  <micah@cowan.name>
 +
 +      * Makefile.am: Remove intermediary hg-id file generation, make
 +      version.c-generation more portable.
 +
 +2007-10-14  Micah Cowan  <micah@cowan.name>
 +
 +      * cmpt.c, cookies.c, ftp-basic.c, ftp-ls.c, ftp.c, hash.c,
 +      host.c, html-parse.c, html-url.c, http-ntlm.c, http.c, init.c,
 +      log.c, main.c, netrc.c, openssl.c, res.c, url.c, utils.c,
 +      wget.h: Replace uses of ISSPACE, etc with c_isspace, etc.
 +      * gnu-md5.c, gnu-md5.h: Removed, in deference to gnulib.
 +      * Makefile.am: Removed gnu-md5.h from wget_SOURCES.
 +      * gen-md5.c: Changed #inclusion of gnu-md5.h to md5.h (gnulib's).
 +      * recur.c (download_child_p): Print error if unlink of
 +      robots.txt fails.
 +      * main.c (main): --spider or --delete-after now implies
 +      --no-directories (thanks, Josh Williams).
 +
 +2007-10-14  Joshua David Williams  <yurimxpxman@gmail.com>
 +
 +      * recur.c (download_child_p): Remove robots.txt if
 +      --delete-after or --spider is on.
 +
 +2007-10-13  Micah Cowan  <micah@cowan.name>
 +
 +      * Makefile.am: Make version.c depend on Wget dependencies (source
 +      files, plus such things as LIBOBJS so we get things like
 +      http-ntlm.c). Removed getopt.[ch], as we're now using gnulib for
 +      these.
 +
 +2007-10-10  Micah Cowan  <micah@cowan.name>
 +
 +      * http-ntlm.c: Include openssl/opensslv.h explicitly, instead of
 +      hoping it'll be included by accident in openssl/des.h.
 +
 +2007-10-09  Gisle Vanem  <gvanem@broadpark.no>
 +
 +      * mswindows.c: 'argc' and 'argv' in 'windows_main()' are no longer
 +      needed.  Hence simply the prototype. Free 'exec_name' at exit.
 +
 +2007-10-09  Micah Cowan  <micah@cowan.name>
 +
 +      * gettext.h: Imported from /usr/share/gettext, fuller handling
 +      of --disable-nls.
 +      * wget.h: Remove logic for handling lack of NLS (now in
 +      gettext.h).
 +      * main.c: Use gettext's ENABLE_NLS rather than HAVE_NLS.
 +      * Makefile.am: added @LIBINTL@ to LIBS (though it probably
 +      belongs in LDADD, along with everything else currently assigned
 +      to LIBS).
 +
 +2007-10-08  Micah Cowan  <micah@cowan.name>
 +
 +      * http.c (http_loop): Add send_head_first conditional back
 +      around code that needs it, but not around the last-modified
 +      header-parsing stuff this time. Removed no-longer-useful (was it
 +      ever?) restart_loop boolean, continuing unconditionally at end
 +      of send_head_first conditional block (if we haven't jumped out).
 +
  2007-10-04  Micah Cowan  <micah@cowan.name>
  
        * http.c (http_loop): We've got_name if content_disposition
        support isn't on; make sure we continue properly in that case,
        even though we're not sending HEAD.
 +      * Makefile.in: Removed, replaced by Makefile.am.
 +      * Makefile.am: Converted from Makefile.in.
 +
 +2007-10-02  Gisle Vanem  <gvanem@broadpark.no>
 +      
 +      * ftp.c: Use "_listing" for MSDOS (".listing" is illegal).
 +
 +      * url.c: Update comment for 'filechr_not_windows'.
 +
 +      * utils.c: Include <process.h> for 'getpid()' on Watcom.
  
  2007-10-02  Micah Cowan  <micah@cowan.name>
  
        before statements.
  
  2003-10-02  Gisle Vanem  <giva@bgnett.no>
 -        
 -        * mswindows.c (run_with_timeout): For Windows: Run the 'fun' in a
 +      
 +      * mswindows.c (run_with_timeout): For Windows: Run the 'fun' in a
        thread via a helper function. Continually query the thread's
        exit-code until finished or timed out.
  
  2001-02-23  Dan Harkless  <wget@harkless.org>
  
        * main.c (print_help): --help documentation for -N said it would
 -      re-download files if they had the _same_ timestamp on server.
 +      re-download files if they had the _same_ timestamp on server.
        (print_help): -nr belongs in "FTP options" section of --help
        output, not "Recursive retrieval" section.  Alphabetized FTP
        options by long option name.
  2001-02-16  Dan Harkless  <wget@harkless.org>
  
        * init.c (commands): Hack Kampbjørn <hack@hackdata.com> discovered
 -      that "httpsproxy" had been inserted into commands[] out of
 -      alphabetical order, causing "BUG: unknown command `httpuser'".
 +      that "httpsproxy" had been inserted into commands[] out of
 +      alphabetical order, causing "BUG: unknown command `httpuser'".
  
  2001-02-13  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
  
  
  2001-02-08  Christian Fraenkel <christian.fraenkel@gmx.net>
  
 -        * gen_sslfunc.c: verify_callback is now static
 +      * gen_sslfunc.c: verify_callback is now static
  
 -        * gen_sslfunc.c (init_ssl): load certificate if specified
 +      * gen_sslfunc.c (init_ssl): load certificate if specified
  
 -        * gen_sslfunc.c (ssl_printerr): new function
 +      * gen_sslfunc.c (ssl_printerr): new function
  
 -        * init.c: added new --sslcertfile and --sslcertkey switches
 +      * init.c: added new --sslcertfile and --sslcertkey switches
  
 -        * main.c: ditto
 +      * main.c: ditto
  
 -        * options.h: ditto
 +      * options.h: ditto
  
 -        * http.c (gethttp): abort when init_ssl fails
 +      * http.c (gethttp): abort when init_ssl fails
  
  2001-01-23  Herold Heiko  <Heiko.Herold@previnet.it>
  
  2001-01-09  Dan Harkless  <wget@harkless.org>
  
        * html-url.c: A bunch of fixup of `--page-requisites'-related
 -      comments to reflect Hrvoje's changes to my code when transplanting
 -      it into this new file, to fix spelling mistakes, to clarify, etc.
 +      comments to reflect Hrvoje's changes to my code when transplanting
 +      it into this new file, to fix spelling mistakes, to clarify, etc.
  
        * url.c (write_backup_file): Clarified a comment.
        (str_url): Henrik van Ginhoven pointed out on the list that we
        replacing each character with a 'x'.  Use "<password>" instead.
  
        * ftp.c (ftp_retrieve_dirs): The bug where recursion into FTP
 -      directories didn't work if logging in put you in a directory other
 -      than "/" is fixed now.  Removed the comment here warning of the bug.
 +      directories didn't work if logging in put you in a directory other
 +      than "/" is fixed now.  Removed the comment here warning of the bug.
  
        * main.c (print_help): --continue's description was misleading.
 -      We don't "restart", we "resume".  Also, better to say
 -      "partially-downloaded file" rather than just "existing file".
 +      We don't "restart", we "resume".  Also, better to say
 +      "partially-downloaded file" rather than just "existing file".
  
  2001-01-06  Dan Harkless  <wget@harkless.org>
  
  
  2000-11-30  Jan Prikryl  <prikryl@cg.tuwien.ac.at>
  
 -        * ftp-ls.c (ftp_parse_unix_ls): Added second parameter
 -        "ignore_perms" to ignore file and directory permissions for
 -        Windows NT FTP server listings.
 -        (ftp_parse_winnt_ls): New function.
 -        (ftp_parse_ls): Parses UNIX and Windows NT listings
 -        separately. Simple heuristics for distinguishing between UNIX
 -        and MS-DOS-like FTP listing provided by Windows NT FTP service.
 +      * ftp-ls.c (ftp_parse_unix_ls): Added second parameter
 +      "ignore_perms" to ignore file and directory permissions for
 +      Windows NT FTP server listings.
 +      (ftp_parse_winnt_ls): New function.
 +      (ftp_parse_ls): Parses UNIX and Windows NT listings
 +      separately. Simple heuristics for distinguishing between UNIX
 +      and MS-DOS-like FTP listing provided by Windows NT FTP service.
  
  2000-11-29  John Summerfield  <summer@OS2.ami.com.au>
  
  2000-10-27  Dan Harkless  <wget@harkless.org>
  
        * retr.c (retrieve_url): Manually applied T. Bharath
 -      <TBharath@responsenetworks.com>'s patch to get wget to grok
 -      illegal relative URL redirects.  Reformatted and re-commented it.
 +      <TBharath@responsenetworks.com>'s patch to get wget to grok
 +      illegal relative URL redirects.  Reformatted and re-commented it.
  
  2000-10-23  Dan Harkless  <wget@harkless.org>
  
        * connect.c (make_connection and bindport): Manually applied Rob
 -      Mayoff <mayoff@dqd.com>'s 1.5.3 patch to add --bind-address,
 -      changing coding style to GNU's.
 +      Mayoff <mayoff@dqd.com>'s 1.5.3 patch to add --bind-address,
 +      changing coding style to GNU's.
  
        * ftp.c (ftp_loop_internal): --delete-after wasn't implemented for
 -      files downloaded via FTP.  Per a comment, .listing files were not
 +      files downloaded via FTP.  Per a comment, .listing files were not
        counted towards number of bytes and files downloaded because they're 
        deleted anyway.  Well, they aren't under -nr, so count them then.
  
        * init.c: Manually applied Rob Mayoff's 1.5.3 patch to add
 -      --bind-address, alphabetizing, changing coding style to GNU's,
 -      commenting, and renaming cmd_ip_address() to cmd_address() to
 -      imply hostnames also okay.
 +      --bind-address, alphabetizing, changing coding style to GNU's,
 +      commenting, and renaming cmd_ip_address() to cmd_address() to
 +      imply hostnames also okay.
                
        * main.c (main): --delete-after didn't delete the root of the
 -      tree.  Ignore --convert-links if --delete-after was specified.
 -      Manually applied Rob Mayoff's 1.5.3 patch to add --bind-address,
 -      fixing duplicate use of added-since-1.5.3 case value.
 +      tree.  Ignore --convert-links if --delete-after was specified.
 +      Manually applied Rob Mayoff's 1.5.3 patch to add --bind-address,
 +      fixing duplicate use of added-since-1.5.3 case value.
        (print_help): Clarified that --delete-after deletes local files.
        Rob forgot to add a line for his new --bind-address option.
                
        * ftp.c (ftp_retrieve_list): Use new INFINITE_RECURSION #define.
        
        * html.c: htmlfindurl() now takes final `dash_p_leaf_HTML' parameter.
 -      Wrapped some > 80-column lines.  When -p is specified and we're at a 
 +      Wrapped some > 80-column lines.  When -p is specified and we're at a 
        leaf node, do not traverse <A>, <AREA>, or <LINK> tags other than 
        <LINK REL="stylesheet">.
        
        * options.h (struct options): Added new page_requisites field.
  
        * recur.c: Changed "URL-s" to "URLs" and "HTML-s" to "HTMLs".
 -      Calculate and pass down new `dash_p_leaf_HTML' parameter to
 -      get_urls_html().  Use new INFINITE_RECURSION #define.
 +      Calculate and pass down new `dash_p_leaf_HTML' parameter to
 +      get_urls_html().  Use new INFINITE_RECURSION #define.
  
        * retr.c: Changed "URL-s" to "URLs".  get_urls_html() now takes
        final `dash_p_leaf_HTML' parameter.
  2000-05-22  Dan Harkless  <wget@harkless.org>
  
        * main.c (print_help): Added --help line for Damir Dzeko
 -      <ddzeko@zesoi.fer.hr>'s until-now-undocumented --referer option.
 -      Removed comments that --referer and --waitretry were undocumented.
 -      Changed "`.wgetrc' command" to "`.wgetrc'-style command" on --help
 -      line for --execute.
 +      <ddzeko@zesoi.fer.hr>'s until-now-undocumented --referer option.
 +      Removed comments that --referer and --waitretry were undocumented.
 +      Changed "`.wgetrc' command" to "`.wgetrc'-style command" on --help
 +      line for --execute.
  
  2000-05-18  Hrvoje Niksic  <hniksic@iskon.hr>
  
        braces to avoid ambiguous `else'" warnings.  Eliminated them.
        
        * http.c (gethttp): Dan Berger's query string patch is totally
 -      bogus.  If you have two different URLs, gen_page.cgi?page1 and
 -      get_page.cgi?page2, they'll both be saved as get_page.cgi and the
 -      second will overwrite the first.  Also, parameters to implicit
 -      CGIs, like "http://www.host.com/db/?2000-03-02" cause the URLs to
 -      be printed with trailing garbage characters, and could seg fault.
 -      Backing out the patch, which Dan B. informed me by email was just
 -      a kludge to download StarOffice from Sun made necessary due to
 -      wget's unconditional escaping of certain characters (room for an
 -      option there?).
 +      bogus.  If you have two different URLs, gen_page.cgi?page1 and
 +      get_page.cgi?page2, they'll both be saved as get_page.cgi and the
 +      second will overwrite the first.  Also, parameters to implicit
 +      CGIs, like "http://www.host.com/db/?2000-03-02" cause the URLs to
 +      be printed with trailing garbage characters, and could seg fault.
 +      Backing out the patch, which Dan B. informed me by email was just
 +      a kludge to download StarOffice from Sun made necessary due to
 +      wget's unconditional escaping of certain characters (room for an
 +      option there?).
        (http_loop): Heiko introduced "suggest explicit braces to avoid
 -      ambiguous `else'" warnings.  Eliminated them.
 +      ambiguous `else'" warnings.  Eliminated them.
        
        * main.c: Heiko's --wait / --waitretry backwards compatibility
        code looks to have been totally untested -- automatic variable
        
        * http.c (http_loop): Fixed a typo and clarified a comment.
        (http_loop): When -K and -N are specified together, compare size
 -      and timestamp of server file X against local file X.orig (if
 -      extant) rather than converted local file X.
 +      and timestamp of server file X against local file X.orig (if
 +      extant) rather than converted local file X.
        (http_loop): "Local file '%s' is more recent," is sometimes a lie
 -      -- reworded as "Server file no newer than local file '%s' --".
 +      -- reworded as "Server file no newer than local file '%s' --".
        (http_loop): Call new downloaded_file() function to prevent
        wrongful overwriting of .orig file when -N is specified.
        
        * url.c (convert_links): When -K specified, only rename X to
 -      X.orig if downloaded_file() returns TRUE.  Otherwise when we skip
 -      file X due to -N, we clobber an X.orig from a previous invocation.
 +      X.orig if downloaded_file() returns TRUE.  Otherwise when we skip
 +      file X due to -N, we clobber an X.orig from a previous invocation.
        (convert_links): Call the failsafe xstrdup(), not the real strdup().
        (convert_links): Added a note asking anyone who understands how
        multiple URLs can correspond to a single file to comment it.
  1998-09-10  Howard Gayle  <howard@fjst.com>
  
        * url.c (get_urls_html): Would drop the last character of the
 -      link.
 +      link.
  
  1998-09-10  Hrvoje Niksic  <hniksic@srce.hr>
  
  1998-06-16  Hrvoje Niksic  <hniksic@srce.hr>
  
        * url.c (get_urls_html): Use malloc() instead of alloca in the
 -      loop.
 +      loop.
  
  1998-06-13  Hrvoje Niksic  <hniksic@srce.hr>
  
  1998-05-27  Hrvoje Niksic  <hniksic@srce.hr>
  
        * ftp.c (getftp): Added `break'; suggested by Lin Zhe Min
 -      <ljm@ljm.wownet.net>.
 +      <ljm@ljm.wownet.net>.
  
  1998-05-24  Hrvoje Niksic  <hniksic@srce.hr>
  
  1998-05-05  Hrvoje Niksic  <hniksic@srce.hr>
  
        * http.c (parse_http_status_line): Avoid `minor' and `major'
 -      names.
 +      names.
  
  1998-05-02  Hrvoje Niksic  <hniksic@srce.hr>
  
        (numdigit): Use `while' loop.
  
        * http.c (create_authorization_line): Detect authentication
 -      schemes case-insensitively.
 +      schemes case-insensitively.
  
        * http.c (extract_header_attr): Use strdupdelim().
        (digest_authentication_encode): Move declaration of local
 -      variables to smaller scope.
 +      variables to smaller scope.
        (digest_authentication_encode): Reset REALM, OPAQUE and NONCE.
        (create_authorization_line): Detect authentication schemes
        case-insensitively.
        * headers.c (header_get): New argument FLAGS.
  
        * http.c (gethttp): If request is malformed, bail out of the
 -      header loop.
 +      header loop.
        (gethttp): Check for empty header *after* the status line checks.
        (gethttp): Disallow continuations for status line.
  
        * utils.c (mkdirhier): Use 0777 instead of opt.dirmode.
  
        * init.c (cmd_spec_dotstyle): Use 48 dots per line for binary
 -      style.
 +      style.
        (cmd_permissions): Removed.
  
        * config.h.in: Add template for WORDS_BIGENDIAN.
  1998-03-17  Hrvoje Niksic  <hniksic@srce.hr>
  
        * utils.c (memfatal): Set save_log_p to 0 to avoid potential
 -      infloop.
 +      infloop.
  
        * log.c: do_logging -> save_log_p.
  
  1998-03-07  Tim Adam  <tma@osa.com.au>
  
        * recur.c (parse_robots): Correctly reset `entries' on empty
 -      disallow.
 +      disallow.
  
  1998-03-07  Hrvoje Niksic  <hniksic@srce.hr>
  
        * url.c (add_url): Add to the head of the list.
  
        * ftp.c (ftp_retrieve_list): Set the permissions to downloaded
 -      file.
 +      file.
        (getftp): Set the default permissions to 0600.
  
  1998-02-21  Hrvoje Niksic  <hniksic@srce.hr>
        * wget.h (FREE_MAYBE): New macro.
  
        * http.c (create_authorization_line): Don't use ANSI C string
 -      concatenation feature.
 +      concatenation feature.
        (basic_authentication_encode): Use alloca() for temporary
 -      variables.
 +      variables.
  
        * recur.h: Ditto.
  
        (calculate_skey_response): Use alloca().
  
        * http.c (create_authorization_line): Work with FSF's version of
 -      md5.c.
 +      md5.c.
  
        * md5.c: New file, from GNU libc.
  
        * ftp.c (ftp_loop): Determine `filename' more precisely.
  
        * init.c (setval): Don't set `opt.quiet' if output-document is
 -      `-'.
 +      `-'.
  
        * log.c (log_init): Print to STDERR instead of STDOUT.
        (vlogmsg): Use STDERR by default.
  
        * main.c (print_help): Rearranged.
        (main): New long options for -n* short options: --no-directories,
 -      --no-host-directories, --non-verbose, --no-host-lookup and
 -      --dont-remove-listing.
 +      --no-host-directories, --non-verbose, --no-host-lookup and
 +      --dont-remove-listing.
  
  1998-02-01  Hrvoje Niksic  <hniksic@srce.hr>
  
        * log.c: New variable LOGFP.
        (vlogmsg): Use it.
        (redirect_output): Don't open /dev/null; set LOGFP to stdin
 -      instead.
 +      instead.
        (log_close): New function.
  
        * options.h (struct options): Removed LFILE.
  
        * host.c (ftp_getaddress): Use STRDUP_ALLOCA.
        (ftp_getaddress): Add diagnostics when reverse-lookup yields only
 -      hostname.
 +      hostname.
  
  1998-01-31  Hrvoje Niksic  <hniksic@srce.hr>
  
        * utils.c (proclist): Pass FNM_PATHNAME to fnmatch().
  
        * ftp-basic.c (ftp_pasv): Avoid unnecessary casting to unsigned
 -      char.
 +      char.
  
        * log.c: Don't attempt to hide arguments from ansi2knr.
  
        * http.c (gethttp): Use it.
  
        * retr.c (get_contents): New argument EXPECTED; pass it to
 -      show_progress().
 +      show_progress().
        (show_progress): New argument EXPECTED; use it to display
 -      percentages.
 +      percentages.
  
        * init.c (setval): Ditto.
  
        * all: Use them.
  
        * sysdep.h: Add wrappers to ctype macros to make them
 -      eight-bit-clean:
 +      eight-bit-clean:
  
  1998-01-30  Hrvoje Niksic  <hniksic@srce.hr>
  
  1997-02-27  Fila Kolodny <fila@ibi.com>
  
        * ftp.c (ftp_retrieve_list): If retrieving symlink and the proper
 -      one already exists, just skip it.
 +      one already exists, just skip it.
  
  1998-01-30  Hrvoje Niksic  <hniksic@srce.hr>
  
        (haccepts_none): Ditto.
  
        * main.c (main): Updated `--version' and `--help' output, as per
 -      Francois Pinard's suggestions.
 +      Francois Pinard's suggestions.
  
        * main.c: Include locale.h; call setlocale(), bindtextdomain() and 
        textdomain().
        * mswindows.c (ws_hangup): Use redirect_output().
  
        * main.c (redirect_output_signal): New function; use
 -      redirect_output().
 +      redirect_output().
  
        * log.c (redirect_output): New function, based on hangup(), which
        is deleted.
  1998-01-24  Karl Heuer  <kwzh@gnu.org>
  
        * netrc.c (search_netrc): Initialize `l' only after processing
 -      netrc.
 +      netrc.
  
        * main.c (main): Don't trap SIGHUP if it's being ignored.
  
        (buf_fd): Ditto.
  
        * http.c (fetch_next_header): Use the BUF_READCHAR macro for
 -      efficiency.
 +      efficiency.
        (gethttp): Use alloca() where appropriate.
  
        * retr.c (buf_readchar): Use it.
  1997-12-18  Hrvoje Niksic  <hniksic@srce.hr>
  
        * all: Renamed nmalloc(), nrealloc() and nstrdup() to xmalloc(),
 -      xrealloc() and xstrdup().  Use the new functions.
 +      xrealloc() and xstrdup().  Use the new functions.
  
        * url.c (decode_string): Made static.
        (has_proto): Ditto.
  1997-06-12  Hrvoje Niksic  <hniksic@srce.hr>
  
        * cmpt.c (strptime_internal): Handle years more correctly for
 -      `%y'.
 +      `%y'.
  
  1997-06-09  Mike Thomas <mthomas@reality.ctron.com>
  
  
        * http.c (check_end): New function.
        (http_atotm): Use it.
 - 
 +
  1997-02-13  gilles Cedoc  <gilles@cedocar.fr>
  
        * http.c (gethttp): Use them.
  1997-02-10  Hrvoje Niksic  <hniksic@srce.hr>
  
        * recur.c (recursive_retrieve): Lowercase the host name, if the
 -      URL is not "optimized".
 +      URL is not "optimized".
  
        * host.c (realhost): Return l->hostname, even if it matches with
 -      host.
 +      host.
  
  1997-02-10  Marin Purgar  <pmc@asgard.hr>
  
        (skip_proto): Skip `//' correctly for FTP and HTTP.
  
        * url.c (get_urls_html): Handle bogus `http:' things a little
 -      different.
 +      different.
  
        * main.c (main): Removed `follow-ftp' from `f'.
        (main): Dumped the `prefix-files' and `file-prefix' options and
 -      features; old and bogus.
 +      features; old and bogus.
        (main): Exit on failed setval() in `-e'.
  
        * http.c (fetch_next_header): Use it to detect header continuation
 -      correctly.
 +      correctly.
  
        * retr.c (buf_peek): New function.
  
        * url.c (parseurl): New argument STRICT.
  
        * http.c (hparsestatline): Be a little-bit less strict about
 -      status line format.
 +      status line format.
  
  1997-01-21  Hrvoje Niksic  <hniksic@srce.hr>
  
        * version.c: "Released" 1.4.3-pre2.
  
        * recur.c (recursive_retrieve): Bypass host checking only if URL
 -      is ftp AND parent URL is not ftp.
 +      is ftp AND parent URL is not ftp.
  
        * ftp-basic.c (ftp_request): Print out Turtle Power.
  
        * ftp.c (ftp_loop): Call ftp_retrieve_glob with 0 if there's no
 -      wildcard.
 +      wildcard.
        (ftp_retrieve_glob): Call ftp_loop_internal even on empty list, if
 -      not glob.
 +      not glob.
  
        * http.c (gethttp): Be a little bit smarter about status codes.
  
        * recur.c (recursive_retrieve): Always reset opt.recursive when
 -      dealing with FTP.
 +      dealing with FTP.
  
  1997-01-18  Hrvoje Niksic  <hniksic@srce.hr>
  
        * retr.c (retrieve_url): New variable location_changed; use it for
 -      tests instead of mynewloc.
 +      tests instead of mynewloc.
        (retrieve_url): Allow heuristic adding of html.
  
        * url.c (url_filename): Don't use the `%' in Windows file names.
        * utils.c (my_touch): New function.
  
        * ftp.c (ftp_retrieve_list): Use #ifdef HAVE_STRUCT_UTIMBUF
 -      instead of #ifndef NeXT.
 +      instead of #ifndef NeXT.
  
        * utils.c (strptime): New version, by Ulrich Drepper.
  
  1997-01-15  Hrvoje Niksic  <hniksic@srce.hr>
  
        * html.c (ftp_index): Don't print minutes and seconds if we don't
 -      know them; beautify the output.
 +      know them; beautify the output.
  
        * ftp.c (getftp): Don't close the socket on FTPNSFOD.
  
        (ftp_parse_ls): Moved from ftp.c.
        (ftp_parse_unix_ls): Recognize seconds in time spec.
        (ftp_parse_unix_ls): Recognize year-less dates of the previous
 -      year.
 +      year.
  
  1997-01-08  Hrvoje Niksic  <hniksic@srce.hr>
  
  1996-12-23  Hrvoje Niksic  <hniksic@srce.hr>
  
        * url.c: Recognize finger, rlogin, tn3270, mid and cid as valid
 -      schemes.
 +      schemes.
  
  1996-12-22  Hrvoje Niksic  <hniksic@srce.hr>
  
  1996-12-17  Hrvoje Niksic  <hniksic@srce.hr>
  
        * retr.c (retrieve_url): Reset opt.recursion before calling
 -      ftp_loop if it is reached through newloc.
 +      ftp_loop if it is reached through newloc.
  
        * init.c (run_wgetrc): Print the wgetrc path too, when reporting
 -      error; don't use "Syntax error", since we don't know if it is
 -      really a syntax error.
 +      error; don't use "Syntax error", since we don't know if it is
 +      really a syntax error.
  
  1996-12-16  Hrvoje Niksic  <hniksic@srce.hr>
  
        * utils.c (acceptable): Extract the filename part of the path.
  
        * recur.c (recursive_retrieve): Call acceptable() with the right
 -      argument; would bug out on wildcards.
 +      argument; would bug out on wildcards.
  
        * init.c (parse_line): Likewise.
  
        * url.c (parseurl): Debug output.
  
        * utils.c (path_simplify): New one, adapted from bash's
 -      canonicalize_pathname().
 +      canonicalize_pathname().
  
  1996-12-14  Hrvoje Niksic  <hniksic@srce.hr>
  
  1996-12-13  Hrvoje Niksic  <hniksic@srce.hr>
  
        * init.c: Make excludes and includes under CVECDIR instead of
 -      CVEC.
 +      CVEC.
  
  1996-12-13  Shawn McHorse  <riffraff@txdirect.net>
  
  1996-12-12  Shawn McHorse  <riffraff@txdirect.net>
  
        * recur.c (retrieve_robots): Print the warning message only if
 -      verbose.
 +      verbose.
  
  1996-12-12  Gregor Hoffleit  <flight@mathi.uni-heidelberg.DE>
  
  1996-12-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
  
        * (configure.in, config.h.in, src/Makefile.in, src/*.[ch]): Add
 -      ansi2knr support for compilers which don't support ANSI style
 -      function prototypes and signatures.
 +      ansi2knr support for compilers which don't support ANSI style
 +      function prototypes and signatures.
  
        * (aclocal.m4, src/ansi2knr.c, src/ansi2knr.1): New files.
  
  1996-11-26  Hrvoje Niksic  <hniksic@srce.hr>
  
        * url.c: Use it; Recognize paths ending with "." and ".." as
 -      directories.
 +      directories.
        (url_filename): Append .n whenever file exists and could be a
 -      directory.
 +      directory.
  
        * url.h (ISDDOT): New macro.
  
        * init.c (parse_line): Use unsigned char.
  
        * url.c (get_urls_html): Cast to unsigned char * when calling
 -      htmlfindurl.
 +      htmlfindurl.
  
        * html.c (htmlfindurl): Use unsigned char.
  
        * ftp.c (getftp): Simplified assertion.
        (ftp_loop_internal): Remove symlink before downloading.
        (ftp_retrieve_list): Unlink the symlink name before attempting to
 -      create a symlink!
 +      create a symlink!
  
        * options.h (struct options): Renamed print_server_response to
 -      server_response.
 +      server_response.
  
        * ftp.c (rel_constr): Removed.
        (ftp_retrieve_list): Don't use it.
  1996-11-24  Hrvoje Niksic  <hniksic@srce.hr>
  
        * http.c (http_loop): Reset newloc in the beginning of function;
 -      would cause FMR in retrieve_url.
 +      would cause FMR in retrieve_url.
  
  1996-11-23  Hrvoje Niksic  <hniksic@srce.hr>
  
        * recur.c (convert_all_links): Find the URL of each HTML document,
 -      and feed it to get_urls_html; would bug out.
 +      and feed it to get_urls_html; would bug out.
        (convert_all_links): Check for l2 instead of dl; removed dl.
  
        * url.c (convert_links): Don't refer to freed newname.
        * Makefile.in (wget): Make `wget' the default target.
  
        * ftp.c (ftp_loop_internal): Move noclobber checking out of the
 -      loop.
 +      loop.
        (ftp_retrieve_list): Warn about non-matching sizes.
  
        * http.c (http_loop): Made -nc non-dependent on opt.recursive.
  1996-11-21  Shawn McHorse  <riffraff@txdirect.net>
  
        * html.c (htmlfindurl): Reset s->in_quote after getting out of
 -      quotes.
 +      quotes.
  
  1996-11-20  Hrvoje Niksic  <hniksic@srce.hr>
  
        * init.c: New command htmlify.
  
        * ftp.c (getftp): Nicer error messages, with `'-encapsulated
 -      strings.
 +      strings.
        (ftp_loop): Print size of index.html.
  
        * init.c (setval): Implement "styles".
  
  1996-11-19  Hrvoje Niksic  <hniksic@srce.hr>
  
 -        * ftp.c (getftp): Close the master socket in case of errors, after
 -        bindport().
 +      * ftp.c (getftp): Close the master socket in case of errors, after
 +      bindport().
  
 -        * connect.c (bindport): Initialize msock to -1.
 +      * connect.c (bindport): Initialize msock to -1.
  
 -        * ftp.c (getftp): Initialize dtsock to -1.
 +      * ftp.c (getftp): Initialize dtsock to -1.
  
 -        * connect.c (closeport): Don't close sock if sock == -1.
 +      * connect.c (closeport): Don't close sock if sock == -1.
  
  1996-11-18  Hrvoje Niksic  <hniksic@srce.hr>
  
        * ftp.c (getftp): Initialize con->dltime.
  
        * recur.c (recursive_retrieve): Use same_host instead of
 -      try_robots; simply load robots_txt whenever the host is changed.
 +      try_robots; simply load robots_txt whenever the host is changed.
        (recursive_retrieve): Free forbidden before calling parse_robots.
  
  1996-11-16  Hrvoje Niksic  <hniksic@srce.hr>
        * retr.c (show_progress): Use them.
  
        * options.h (struct options): New options dot_bytes, dots_on_line
 -      and dot_spacing.
 +      and dot_spacing.
  
  1996-11-16  Mark Boyns  <boyns@sdsu.edu>
  
        * recur.c (recursive_retrieve): Retrieve directories regardless of
 -      acc/rej rules; check for empty u->file.
 +      acc/rej rules; check for empty u->file.
  
  1996-11-14  Hrvoje Niksic  <hniksic@srce.hr>
  
        * utils.c (merge_vecs): New function.
  
        * init.c (setval): Reset the list-type functions when encountering
 -      "".
 +      "".
  
  1996-11-14  Shawn McHorse  <riffraff@txdirect.net>
  
        * recur.c (recursive_retrieve): Use base_url instead of this_url
 -      for no_parent.
 +      for no_parent.
  
  1996-11-14  Shawn McHorse  <riffraff@txdirect.net>
  
        * utils.c (sepstring): Rewrote; don't use strtok.
  
        * recur.c (recursive_retrieve): Enter assorted this_url to slist
 -      when running the first time.
 +      when running the first time.
        (retrieve_robots): Warn to ignore errors when robots are loaded.
  
        * utils.c (load_file): Moved from url.c.
        * ftp.c (ftp_retrieve_dirs): Implemented opt.includes.
  
        * init.c (setval): Free the existing opt.excludes and
 -      opt.includes, if available.
 +      opt.includes, if available.
  
        * main.c (main): New option -I.
  
        * http.c (gethttp): Free all_headers -- would leak.
  
        * recur.c (recursive_retrieve): Initialize depth to 1 instead of
 -      0 -- this fixes a long-standing bug in -rl.
 +      0 -- this fixes a long-standing bug in -rl.
  
  1996-11-09  Hrvoje Niksic  <hniksic@srce.hr>
  
  1996-11-08  Hrvoje Niksic  <hniksic@srce.hr>
  
        * url.c (url_filename): Do not create numbered suffixes if
 -      opt.noclobber -- would bug out on -nc.
 +      opt.noclobber -- would bug out on -nc.
  
  1996-11-07  Hrvoje Niksic  <hniksic@srce.hr>
  
        * recur.c (parse_robots): Don't chuck out the commands without
 -      arguments (`Disallow:<empty>' didn't work).
 +      arguments (`Disallow:<empty>' didn't work).
        (parse_robots): Compare versions lowercase.
        (parse_robots): Match on base_version, not version_string!
        (parse_robots): Handle comments properly.
        * init.c (run_wgetrc): Close fp.
  
        * ftp.c (ftp_retrieve_dirs): Allocate the correct length for
 -      u->dir.
 +      u->dir.
  
  1996-11-06  Hrvoje Niksic  <hniksic@srce.hr>
  
        (ftp_retrieve_glob): Return QUOTEXC on quota exceeded.
  
        * main.c (main): Check for quota by comparison with downloaded
 -      stuff, not from status.
 +      stuff, not from status.
  
        * connect.c (select_fd): Should compile on HPUX without warnings now.
  
        * ftp.c (ftp_get_listing): Check whether ftp_loop_internal
 -      returned RETROK.
 +      returned RETROK.
  
  1996-11-04  Hrvoje Niksic  <hniksic@srce.hr>
  
  1996-11-02  Hrvoje Niksic  <hniksic@srce.hr>
  
        * ftp.c (ftp_loop): Check for opt.ftp_glob too before calling
 -      ftp_retrieve_glob.
 +      ftp_retrieve_glob.
  
        * version.c: Changed version to 1.4.0-test2.
  
        * version.c: Released 1.4.0-test1.
  
        * url.c (str_url): Don't use sprintf when creating %2F-prefixed
 -      directory.
 +      directory.
        (convert_links): Removed definition of make_backup.
  
        * http.h: Removed definition of MAX_ERROR_LENGTH.
        * http.c (gethttp): Use ou->referer instead of u->referer.
  
        * retr.c (retrieve_url): Reset u to avoid freeing pointers twice;
 -      this was known to cause coredumps on Linux.
 +      this was known to cause coredumps on Linux.
  
        * html.c (ftp_index): Cast the argument to local_time to time_t *.
  
        * connect.c (select_fd): Use exceptfds -- once and for all.
  
        * retr.c (retrieve_from_file): Free filename after
 -      recursive_retrieve.
 +      recursive_retrieve.
        (retrieve_from_file): Send RFIRST_TIME to recursive_retrieve on
 -      first-time retrieval.
 +      first-time retrieval.
        (retrieve_from_file): Return uerr_t; new argument, count.
        (retrieve_from_file): Break on QUOTEXC.
  
        * init.c (setquota): Fixed a bug that caused rejection of
 -      non-postfixed values..
 +      non-postfixed values..
  
  1996-10-30  Hrvoje Niksic  <hniksic@srce.hr>
  
  
        * connect.c (iread): Smarter use of select.
        (select_fd): Set errno on timeout.  If not timeout, return 1
 -      instead of 0.
 +      instead of 0.
  
  1996-10-29  Hrvoje Niksic  <hniksic@srce.hr>
  
        * ftp.c (ftp_loop_internal): Don't use con->cmd before
 -      establishing it.
 +      establishing it.
  
  1996-10-26  Hrvoje Niksic  <hniksic@srce.hr>
  
        * http.c (gethttp): Send correct referer when using proxy.
        (gethttp): Use struct urlinfo ou to access the relevant data; send
 -      correct authorization in all cases.
 +      correct authorization in all cases.
  
        * host.c (same_host): Use skip_uname to skip username and
 -      password.
 +      password.
  
        * url.c (skip_uname): New function.
        (parseurl): Use it.
  
        * host.c (same_host): Do not assume HTTP -- same_host should now
 -      be totally foolproof.
 +      be totally foolproof.
  
        * url.c (skip_proto): New function.
        (parse_uname): Use it.
  
        * http.c (gethttp): Create local user and passwd from what is
 -      given.
 +      given.
  
        * url.c (parseurl): Check for HTTP username and password too.
  
        * options.h (struct options): New variable no_parent.
  
        * recur.c (recursive_retrieve): Only files are checked for
 -      opt.accepts and opt.rejects.
 +      opt.accepts and opt.rejects.
        (recursive_retrieve): Check directories for opt.excludes.
        (recursive_retrieve): Make the dir absolute when checking
 -      opt.excludes.
 +      opt.excludes.
  
        * html.c (htmlfindurl): Recognize <applet code=...> and <script
 -      src=...>
 +      src=...>
  
  1996-10-18  Hrvoje Niksic  <hniksic@srce.hr>
  
        * version.c: "Released" 1.4b28.
  
        * ftp.c (ftp_loop_internal): Check whether f->size == len and
 -      don't continue the loop if it is.
 +      don't continue the loop if it is.
        (ftp_get_listing): Remove list_filename on unsuccesful loop.
  
  1996-10-17  Hrvoje Niksic  <hniksic@srce.hr>
        (getftp): Do not use multiline assert.
  
        * http.c (hparsestatline): Use mjr and mnr instead of major and
 -      minor, which don't compile on Ultrix.
 +      minor, which don't compile on Ultrix.
        (http_loop): Use strcpy() to initialize tmp.
  
        * all: Geturl -> Fetch
  1996-10-17  Hrvoje Niksic  <hniksic@srce.hr>
  
        * recur.c (parse_robots): Fixed an off-by-one bug when looking for
 -      ':'.
 +      ':'.
  
        * html.c (htmlfindurl): Fixed several possible off-by-one bugs by
 -      moving `bufsize &&' to the beginning of each check in for-loops.
 +      moving `bufsize &&' to the beginning of each check in for-loops.
  
        * recur.c (parse_robots): Close fp on exit.
  
  
        * ftp.c (ftp_loop): Change FTPOK to RETROK before exiting.
        (delelement): Use next instead of f->next and prev instead of
 -      f->prev.
 +      f->prev.
        (delelement): Free the members of the deleted element.
  
        * http.c (http_loop): Do not return RETROK on code != 20x.
        * http.c (hparsestatline): Docfix.
  
        * main.c (main): Return with error status on unsuccesful
 -      retrieval.
 +      retrieval.
  
        * init.c (setval): Do not remove listing when mirroring.
  
        * url.c (url_filename): Use opt.fileprefix.
  
        * ftp.c (ftp_get_listing): Use url_filename to get filename for
 -      .listing.
 +      .listing.
  
        * main.c (main): New option: -rn.
  
        * version.c: "Released" 1.4b26.
  
        * retr.c (retrieve_from_file): If call get_urls_html with
 -      opt.spider to make it silent in spider mode.
 +      opt.spider to make it silent in spider mode.
  
        * url.c (str_url): Use CLEANDUP instead of URL_CLEANSE.
  
        * url.h (CLEANDUP): New macro.
  
        * http.c (gethttp): Fixed a bug that freed location only when it
 -      was NULL.
 +      was NULL.
  
        * retr.c (retrieve_url): Free url if it will not be stored,
 -      i.e. newloc is NULL.
 +      i.e. newloc is NULL.
  
        * html.c (htmlfindurl): Handle exiting from quotes correctly; the
 -      old version would bug out on <a href="x#a"href="y">.
 +      old version would bug out on <a href="x#a"href="y">.
  
        * html.h (state_t): New member in_quote.
  
        * html.c (htmlfindurl): Free s->attr at the beginning of
 -      attr-loop.
 +      attr-loop.
  
        * recur.c (recursive_retrieve): Recognize RCLEANUP.
        (tried_robots): Make hosts a global variable.
        * utils.c (free_slist): New function.
  
        * recur.c (recursive_retrieve): Use flags to add cleanup
 -      possibility.
 +      possibility.
  
        * main.c (main): Free filename after recursive_retrieve.
  
  1996-10-12  Hrvoje Niksic  <hniksic@srce.hr>
  
        * all: Constified the whole source.  This required some minor
 -      changes in many functions in url.c, possibly introducing bugs -- I
 -      hope not.
 +      changes in many functions in url.c, possibly introducing bugs -- I
 +      hope not.
  
        * ftp-basic.c: Removed last_respline.
  
        * main.c (main): Sorted the options.
  
        * connect.c (iread): Set errno to ETIMEDOUT only if it was left
 -      uninitialized by select().
 +      uninitialized by select().
  
        * http.c (http_loop): Print the time when the connection is
 -      closed.
 +      closed.
        (gethttp): Debug-print the HTTP request.
  
  1996-10-11  Hrvoje Niksic  <hniksic@srce.hr>
        * version.c: "Released" 1.4b25.
  
        * ftp-unix.c (ftp_parse_unix_ls): Ignore lines without file name
 -      or link name.
 +      or link name.
  
        * http.c (gethttp): Add errcode to struct hstat.
        (http_loop): Use it.
        (elapsed_time): New function.
  
        * retr.c (show_progress): Make bytes_in_line and offs long; should
 -      work on 16-bit machines.
 +      work on 16-bit machines.
  
  1996-10-08  Hrvoje Niksic  <hniksic@srce.hr>
  
        * url.c (in_acclist): New argument backward.
  
        * ftp.c (ftp_retrieve_glob): Use acceptable() to determine whether
 -      a file should be retrieved according to suffix.
 +      a file should be retrieved according to suffix.
        (ftp_get_listing): Check the return value of unlink; Do not call
 -      ftp_retrieve_dirs if depth reached maxreclevel.
 +      ftp_retrieve_dirs if depth reached maxreclevel.
        (ftp_retrieve_dirs): Check whether the directory is in
 -      exclude-list.
 +      exclude-list.
  
        * main.c (main): Print the version number at the beginning of
 -      DEBUG output.
 +      DEBUG output.
        (main): Use strrchr when creating exec_name.
  
        * ftp.c (ftp_retrieve_glob): Do not close control connection.
        * retr.c (time_str): Check for failed time().
  
        * html.c (htmlfindurl): Recognize <fig src> and <overlay src> from
 -      HTML3.0.
 +      HTML3.0.
  
        * retr.c (time_str): Return time_t *.
  
        * geturl.texi: New file.
  
        * main.c (main): Do not print the warnings and download summary if
 -      opt.quiet is set.
 +      opt.quiet is set.
  
        * version.c: Changed version to 1.4b23.
  
        * "Released" 1.4b22.
  
        * atotm.c (atotm): Use True and False instead of TRUE and FALSE,
 -      to avoid redefinition warnings.
 +      to avoid redefinition warnings.
  
        * host.c (store_hostaddress): Use memcpy() to copy the address
 -      returned by inet_addr.
 +      returned by inet_addr.
  
        * version.c: Changed version to 1.4b22.
  
        * ftp-unix.c (ftp_parse_ls): Recognize time in h:mm format.
  
        * ftp.c (ftp_retrieve_dirs): Fixed a bug that caused incorrect
 -      CWDs to be sent with recursive FTP retrievals.
 +      CWDs to be sent with recursive FTP retrievals.
  
  1996-10-03  Hrvoje Niksic  <hniksic@srce.hr>
  
        * recur.c (parse_robots): Made it more compliant with "official"
 -      specifications.
 +      specifications.
  
        * http.c: New function.
  
        * ftp-unix.c (ftp_parse_ls): Added better debug output.
  
        * ftp.c (getftp): Print out the LIST in case of
 -      opt.print_server_response.
 +      opt.print_server_response.
  
        * version.c: Changed version to 1.4b21.
  
        * README: Update.
  
        * http.c (gethttp): Preset lengths of various headers instead of
 -      calculating them dynamically.
 +      calculating them dynamically.
        (gethttp): Check for 206 partial contents.
  
  1996-09-30  Hrvoje Niksic  <hniksic@srce.hr>
        * http.c (gethttp): Send host: header.
        (gethttp): Add the possibility of user-defined headers.
        (gethttp): Move decision about pragma: no-cache to http_loop,
 -      where it belongs.
 +      where it belongs.
        (gethttp): Pass a struct instead of enormous argument list.
        (http_loop): Use a new, fancier display format.
        (ftp_loop): Likewise.
        * http.c (http_loop): Add restart capabilities.
  
        * ftp.c (ftp_retrieve_glob): Fixed a bug that could cause matchres
 -      being used uninitialized.
 +      being used uninitialized.
        (ftp_retrieve_list): Similar fix.
  
        * host.c (add_hlist): Fixed a bug that could cause cmp being used
 -      uninitialized.
 +      uninitialized.
  
        * url.c (construct_relative): New function.
  
        * init.c (setval): New option: SAVEHEADERS
  
        * ftp.c (ftp_loop_internal): Do not set restval if listing is to
 -      be retrieved. Lack of this test caused bugs when the connection
 -      was lost during listing.
 +      be retrieved. Lack of this test caused bugs when the connection
 +      was lost during listing.
  
        * retr.c (retrieve_url): Fixed a bug that caused
 -      coredumps. *newloc is now reset by default.
 +      coredumps. *newloc is now reset by default.
        (retrieve_url): Lift the twenty-tries limit on proxies.
  
        * version.c: Changed version to 1.4b20.
  1996-09-17  Hrvoje Niksic  <hniksic@srce.hr>
  
        * ftp.c (ftp_retrieve_list): Fixed a bug that caused setting
 -      incorrect values to files pointed to by symbolic links.
 +      incorrect values to files pointed to by symbolic links.
        (ftp_1fl_loop): Do not count listings among the downloaded URL-s.
  
  1996-09-16  Hrvoje Niksic  <hniksic@srce.hr>
        * main.c (main): Rename "server-headers" to "server-response".
  
        * ftp-unix.c (ftp_parse_ls): Check for asterisks at the end of
 -      executables in 'ls -F' listings.
 +      executables in 'ls -F' listings.
  
  1996-09-15  Hrvoje Niksic  <hniksic@srce.hr>
  
        (str_url): Get rid of sprintf().
  
        * recur.c (recursive_retrieve): Enable FTP recursion through proxy
 -      servers.
 +      servers.
  
        * url.h (URL_CLEANSE): Made it else-resistant.
        (USE_PROXY): New macro.
  1996-09-14  Drazen Kacar  <dave@fly.cc.fer.hr>
  
        * html.c (htmlfindurl): Added <frame src> and <iframe src> among
 -      the list of stuff to fetch.
 +      the list of stuff to fetch.
  
  1996-09-13  Hrvoje Niksic  <hniksic@srce.hr>
  
        * url.c (get_urls_html): Fixed a bug that caused SIGSEGV's with
 -      -Fi.
 +      -Fi.
  
        * html.c (htmlfindurl): Rewrite.
  
        * main.c (main): Added --cache option.
  
        * ftp.c (ftp_response): Print server response if opt.print_server
 -      response is set.
 +      response is set.
        (getftp): Print newlines after each request if the server response
 -      is to be printed.
 +      is to be printed.
        (ftp_response): Copy the last response line to last_respline.
  
        * http.c (gethttp): Add Pragma: nocache for retried
 -      proxy-retrievals.
 +      proxy-retrievals.
  
        * ftp.c (getftp): Use it.
  
  
        * ftp.c (ftp_response): Use buf_readchar().
        (getftp): Flush the control connection buffer before calling
 -      get_contents().
 +      get_contents().
  
        * retr.c (buf_readchar): New function.
        (buf_flush): New function.
        * ftp.c: Incorporate changes to ftp_response.
  
        * ftp.c (ftp_response): Allocate the server response dynamically,
 -      as in read_whole_line and fetch_next_header.
 +      as in read_whole_line and fetch_next_header.
  
        * utils.c (read_whole_line): Fixed a bug that prevented reading
 -      the last line if it is not \n-terminated. Also fixed a possible
 -      memory overflow.
 +      the last line if it is not \n-terminated. Also fixed a possible
 +      memory overflow.
  
        * http.c (fetch_next_header): Return malloc-ed string as large as
 -      needed.
 +      needed.
        (gethttp): Use new fetch_next_header.
  
  1996-09-12  Hrvoje Niksic  <hniksic@srce.hr>
        * version.c: "Released" 1.4b17.
  
        * ftp-unix.c (ftp_parse_ls): If unable to open file, return NULL
 -      instead of failed assertion.
 +      instead of failed assertion.
  
  1996-09-09  Hrvoje Niksic  <hniksic@srce.hr>
  
        * ftp.c (ftp_get_listing): Add a numbered suffix to LIST_FILENAME
 -      if a file of that name already exists.
 +      if a file of that name already exists.
  
  1996-09-05  Hrvoje Niksic  <hniksic@srce.hr>
  
        * ftp.c (ftp_1fl_loop): Handler FTPPORTERR and FOPENERR correctly.
  
        * config.h.in: Define gethostbyname as Rgethostbyname when using
 -      Socks.
 +      Socks.
  
        * configure.in: Check for -lresolv if using Socks.
  
        * version.c: "Released" 1.4b16.
  
        * http.c (gethttp): More intelligent check for first line of HTTP
 -      response.
 +      response.
        (gethttp): Would bug out on time-stamping.
  
        * version.c: Changed version to 1.4b16.
        * url.h (ISDOT): New macro.
  
        * recur.c (recursive_retrieve): Change only opt.recursive for
 -      following FTP.
 +      following FTP.
  
  1996-07-11  Antonio Rosella <antonio.rosella@agip.it>
  
  1996-07-11  Hrvoje Niksic  <hniksic@srce.hr>
  
        * url.c (url_filename): Check for opt.dirstruct instead for
 -      opt.recursive && opt.dirstruct.
 +      opt.recursive && opt.dirstruct.
  
        * init.c (defaults): Ditto.
        (defaults): Reset dirstruct by default.
        * socks/geturl.cgi: Changed /pub/bin/perl to /usr/bin/perl.
  
        * socks/download.html: Created from download-netscape.html, made
 -      HTML-2.0 compliant.
 +      HTML-2.0 compliant.
  
        * recur.c (recursive_retrieve): Set opt.force_dir_hier when
 -      following FTP links from recursions.
 +      following FTP links from recursions.
  
  1996-07-09  Hrvoje Niksic  <hniksic@srce.hr>
  
        * url.c (mymkdir): Fixed a bug that prevented mymkdir() to create
 -      absolute directories correctly.
 +      absolute directories correctly.
  
        * version.c: Changed version to 1.4b14.
  
        * url.c (make_backup): New function.
  
        * http.c (http_loop): Make a backup copy of the local file (using
 -      rename(2)) before opening it.
 +      rename(2)) before opening it.
  
        * main.c (main): Added --backups.
  
        (ftp_getaddress): Check for empty, null or (null) domain.
  
        * url.c (get_urls_html): If this_url is NULL, the base must have a
 -      protocol.
 +      protocol.
        (parseurl): Use has_proto.
  
        * retr.c (retrieve_url): Warn when proxy is used with more than 20
 -      retries.
 +      retries.
  
        * url.c (mkstruct): Create the directory (calling mymkdir()) only
 -      if it is not already there.
 +      if it is not already there.
        (has_proto): New function.
        (get_urls_html): Eliminate the remaining call to findurl -- use
 -      has_proto.
 +      has_proto.
  
        * geturl.1: Ditto.
  
        * main.c: Change -X to -x.
  
        * url.c (url_filename): Simplify creation of filename if
 -      prefix_files is set.
 +      prefix_files is set.
        (url_filename): Simplify everything. And I do mean *everything*.
        (mkstruct): Add dir_prefix before hostname.
        (path_simplify): Fixed a bug that caused writing outside the path
 -      string in case of "." and ".." path strings.
 +      string in case of "." and ".." path strings.
  
  1996-07-06  Hrvoje Niksic  <hniksic@srce.hr>
  
        * http.c (gethttp): Use referer if present.
  
        * recur.c (recursive_retrieve): Set u->referer before calling
 -      retrieve_url.
 +      retrieve_url.
  
        * url.c (newurl): Use memset to nullify the struct members.
        (freeurl): Free the referer field too.
        * configure.in: Add the support for socks.
  
        * url.c (url_filename): If the dir_prefix is ".", work with just
 -      the file name.
 +      the file name.
        (url_filename): Do not look for .n extensions if timestamping if
 -      turned on.
 +      turned on.
  
        * retr.c (show_progress): Skip the over-abundant restval data, and
 -      print the rest of it with ',' instead of '.'.
 +      print the rest of it with ',' instead of '.'.
  
  1996-07-05  Hrvoje Niksic  <hniksic@srce.hr>
  
        * retr.c (show_progress): Changed second arg. to long (as it
 -      should be).
 +      should be).
        (show_progress): Moved to retr.c.
        (get_contents): Moved to retr.c.
  
        (get_urls_html): Use new parameters for htmlfindurl.
  
        * html.c: Removed memorizing "parser states", since the new
 -      organization does not require them.
 +      organization does not require them.
  
        * init.c (run_geturlrc): Use read_whole_line.
  
        * recur.c (tried_robots): Use add_slist/in_slist, *much* cleaner.
  
        * host.c (ngethostbyname): Call inet_addr just once. Yet to be
 -      tested on OSF and Ultrix.
 +      tested on OSF and Ultrix.
        (add_hlist): New function.
        (free_hlist): New function.
        (search_host): New function.
        (search_address): New function.
        (realhost): Use search_host, search_address and add_hlist.
        (same_host): Replaced realloc() with strdupdelim(), made
 -      case-insensitive, fixed a memory leak.
 +      case-insensitive, fixed a memory leak.
  
        * html.c (ftp_index): Fixed tm_min and tm_sec to be tm_hour and
 -      tm_min, like intended.
 +      tm_min, like intended.
  
        * version.c: Change user agent information to
 -      Geturl/version.
 +      Geturl/version.
  
  1996-07-03  Hrvoje Niksic  <hniksic@srce.hr>
  
        * url.c (acceptable): Always accept directories.
  
        * ftp-unix.c (ftp_parse_ls): Support brain-damaged "ls -F"-loving
 -      servers by stripping trailing @ from symlinks and trailing / from
 -      directories.
 +      servers by stripping trailing @ from symlinks and trailing / from
 +      directories.
  
        * ftp.c (ftp_loop): Debugged the "enhanced" heuristics. :-)
  
  
        * url.c (match_backwards_or_pattern): Fixed i == -1 to j == -1.
        (match_backwards): New function, instead of
 -      match_backwards_or_pattern.
 +      match_backwards_or_pattern.
  
        * recur.c (recursive_retrieve): Increased performance by
 -      introducing inl, which reduces number of calls to in_slist to only
 -      one.
 +      introducing inl, which reduces number of calls to in_slist to only
 +      one.
  
        * ftp.c (ftp_loop): Enhanced the heuristics that decides which
 -      routine to use.
 +      routine to use.
  
        * main.c (printhelp): Removed the warranty stuff.
  
  1996-06-30  Hrvoje Niksic  <hniksic@srce.hr>
  
        * ftp.c (ftp_loop): Call ftp_index on empty file names, if not
 -      recursive.
 +      recursive.
  
        * html.c (ftp_index): Fixed to work. Beautified the output.
  
        * ftp.c (ftp_retrieve_glob): Another argument to control whether
 -      globbing is to be used.
 +      globbing is to be used.
        (ftp_retrieve_list): Compare the time-stamps of local and remote
 -      files to determine whether to download.
 +      files to determine whether to download.
  
  1996-06-29  Hrvoje Niksic  <hniksic@srce.hr>
  
        * ftp.c (rel_constr): New function.
  
        * retr.c (retrieve_from_file): Check for text/html before
 -      retrieving recursively.
 +      retrieving recursively.
  
        * main.c (main): Check whether the file is HTML before going into
 -      recursive HTML retrieving.
 +      recursive HTML retrieving.
  
        * ftp.c (ftp_retrieve_list): Manage directories.
        (ftp_retrieve_glob): Pass all the file-types to ftp_retrieve_list.
        (ftp_1fl_loop): Fixed a bug that caused con->com to be incorrectly
 -      initialized, causing bugchecks in getftp to fail.
 +      initialized, causing bugchecks in getftp to fail.
  
        * configure.in: Check for symlink.
  
        * version.c: 1.4b9 "released".
  
        * recur.c (recursive_retrieve): Used linked list (ulist) for
 -      faster storing of URLs.
 +      faster storing of URLs.
  
        * url.c (get_urls_html): Removed the old kludge with comparing the
 -      outputs of htmlfindurl and findurl.
 +      outputs of htmlfindurl and findurl.
        (get_urls_html): Added better protocol support here.
        (create_hash): Removed, as well as add_hash and in_hash.
        (addslist): New function.
        * version.c: New version.
  
        * main.c (hangup): New function, that handles hangup. Hangup
 -        signal now causes geturl to stop writing on stdout, and to write
 -        to a log file.
 +      signal now causes geturl to stop writing on stdout, and to write
 +      to a log file.
  
        * ftp.c (getftp): "Released" 1.4b7.
  
        * retr.c (retrieve_from_file): New function.
  
        * url.c (parseurl): Modified to return URLOK if all OK. Protocol
 -        can be found in u->proto.
 +      can be found in u->proto.
  
        * ftp.c (ftp_response): Fixed to accept multi-line responses as
 -        per RFC 959.
 +      per RFC 959.
  
        * recr.c (recursive_retrieve): Take newloc from retrieve_url.
  
        * url.c (mymkdir): Removed the file of the same name, if one
 -        exists.
 +      exists.
        (isfile): New function.
        (mkstruct): Fixed the '/' glitches.
        (path_simplify): Hacked to treat something/.. correctly.
        (http_loop): HEOF no longer a fatal header.
  
        * loop.c (retrieve_url): When dt is NULL, do not modify it. This
 -        simplifies the syntax of calling retrieve_url.
 +      simplifies the syntax of calling retrieve_url.
  
        * recr.c (recursive_retrieve): Modified to use get_urls_html.
  
        (get_urls_html): New function.
  
        * recr.c (recursive_retrieve): Patched up to conform to the
 -        standards.
 +      standards.
  
        * http.c (gethttp): Synched with the rest...
        (gethttp): Treat only CONREFUSED specially, with connection
        * loop.c: Removed *lots* of stuff from retrieve_url.
  
        * url.c (parseurl): Changed to work with urlinfo. Integrated
 -        username finding and path parsing.
 +      username finding and path parsing.
        (newurl): New function.
        (freeurl): New function.
        (mkstruct): Removed the old bogosities, made it urlinfo-compliant.
  1996-06-19  Hrvoje Niksic  <hniksic@srce.hr>
  
        * url.c (hide_url): Thrown out the protocol assertion. Do not
 -        change the URL if the protocol if not recognized.
 +      change the URL if the protocol if not recognized.
        (findurl): Put continue instead of break.
  
  1996-06-18  Hrvoje Niksic  <hniksic@srce.hr>
  
        * sample.geturlrc: Changed the defaults to be commented out and
 -        harmless (previous defaults caused pains if copied to
 -        ~/.geturlrc).
 +      harmless (previous defaults caused pains if copied to
 +      ~/.geturlrc).
  
        * http.c (gethttp): Print the HTTP request in debug mode.
  
        * connect.c (iread): Added EINTR check loop to select-ing
 -        too. EINTR is now correctly handled with select().
 +      too. EINTR is now correctly handled with select().
  
        * TODO: new file
  
  1996-05-07  Hrvoje Niksic  <hniksic@srce.hr>
  
        * host.c (same_host): Made the function a little bit more
 -        intelligent regarding diversified URL syntaxes.
 +      intelligent regarding diversified URL syntaxes.
  
        * url.c (skip_url): Spaces are now skipped after URL:
  
        * Released 1.3.1 with the patch to prevent crashing when sending
 -        NULL to robot* functions and the patch to compile "out of the box"
 -        on AIX.
 +      NULL to robot* functions and the patch to compile "out of the box"
 +      on AIX.
  
        * recr.c (recursive_retrieve): Added checking whether this_url is
        NULL when calling the robot functions.
diff --combined src/Makefile.am
index 709db8acf5e090b325192f2f6866d90626b3650a,0000000000000000000000000000000000000000..8d3270150c97d92e5d65849473379bbc2578944b
mode 100644,000000..100644
--- /dev/null
@@@ -1,63 -1,0 +1,64 @@@
- # In addition, as a special exception, the Free Software Foundation
- # gives permission to link the code of its release of Wget with the
- # OpenSSL project's "OpenSSL" library (or with modified versions of it
- # that use the same license as the "OpenSSL" library), and distribute
- # the linked executables.  You must obey the GNU General Public License
- # in all respects for all of the code used other than "OpenSSL".  If you
- # modify this file, you may extend this exception to your version of the
- # file, but you are not obligated to do so.  If you do not wish to do
- # so, delete this exception statement from your version.
 +# Makefile for `wget' utility
 +# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
 +# 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
 +# the Free Software Foundation; either version 3 of the License, or
 +# (at your option) any later version.
 +
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
 +
 +# You should have received a copy of the GNU General Public License
 +# along with Wget.  If not, see <http://www.gnu.org/licenses/>.
 +
++# Additional permission under GNU GPL version 3 section 7
++
++# If you modify this program, or any covered work, by linking or
++# combining it with the OpenSSL project's OpenSSL library (or a
++# modified version of that library), containing parts covered by the
++# terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
++# grants you additional permission to convey the resulting work.
++# Corresponding Source for a non-source form of such a combination
++# shall include the source code for the parts of OpenSSL used as well
++# as that of the covered work.
 +
 +#
 +# Version: @VERSION@
 +#
 +
 +# The following line is losing on some versions of make!
 +DEFS     = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
 +LIBS     = @LIBS@ @LIBSSL@ @LIBGNUTLS@ @LIBINTL@
 +
 +bin_PROGRAMS = wget
 +wget_SOURCES = cmpt.c connect.c convert.c cookies.c ftp.c ftp-basic.c \
 +             ftp-ls.c hash.c host.c html-parse.c html-url.c http.c    \
 +             init.c log.c main.c netrc.c progress.c ptimer.c recur.c  \
 +             res.c retr.c snprintf.c spider.c url.c   \
 +             utils.c xmalloc.c                                \
 +             connect.h convert.h cookies.h            \
 +             ftp.h gen-md5.h hash.h host.h html-parse.h \
 +             http.h http-ntlm.h init.h log.h mswindows.h netrc.h \
 +             options.h progress.h ptimer.h recur.h res.h retr.h \
 +             spider.h ssl.h sysdep.h url.h utils.h wget.h xmalloc.h
 +nodist_wget_SOURCES = version.c
 +EXTRA_wget_SOURCES = mswindows.c
 +LDADD = $(ALLOCA) $(LIBOBJS) ../lib/libgnu.a
 +AM_CPPFLAGS = -I$(top_srcdir)/lib
 +
 +version.c:  $(wget_SOURCES) $(LDADD) $(srcdir)/Makefile.am
 +      echo 'const char *version_string = "@VERSION@"' > $@
 +      -hg log -r . --template='" ({node|short})"\n' 2>/dev/null >> $@
 +      echo ';' >> $@
 +
 +check_LIBRARIES = libunittest.a
 +libunittest_a_SOURCES = $(wget_SOURCES) test.c test.h
 +nodist_libunittest_a_SOURCES = version.c
 +libunittest_a_CPPFLAGS = -DTESTING -I$(top_srcdir)/lib
 +libunittest_a_LIBADD = $(ALLOCA) $(LIBOBJS)
 +
 +CLEANFILES = *~ *.bak core core.[0-9]* version.c
diff --combined src/cmpt.c
index ff60842da01a100127cba238d017bc06168a0d1a,35b72ff5626a602f963e42e9d8ba21b90ab10e96..2436cf60dfee4d6f18e8dc5efb927638f4cacc94
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -40,6 -41,8 +41,6 @@@
  
  #include <errno.h>
  
 -#include "wget.h"
 -
  /* Some systems lack certain functions normally taken for granted.
     For example, Windows doesn't have strptime, and some systems don't
     have a usable fnmatch.  This file should contain fallback
@@@ -71,8 -74,8 +72,8 @@@ strcasecmp (const char *s1, const char 
  
    do
      {
 -      c1 = TOLOWER (*p1++);
 -      c2 = TOLOWER (*p2++);
 +      c1 = c_tolower (*p1++);
 +      c2 = c_tolower (*p2++);
        if (c1 == '\0')
          break;
      }
@@@ -100,8 -103,8 +101,8 @@@ strncasecmp (const char *s1, const cha
  
    do
      {
 -      c1 = TOLOWER (*p1++);
 -      c2 = TOLOWER (*p2++);
 +      c1 = c_tolower (*p1++);
 +      c2 = c_tolower (*p2++);
        if (c1 == '\0' || c1 != c2)
          return c1 - c2;
      } while (--n > 0);
@@@ -430,9 -433,9 +431,9 @@@ strptime_internal (rp, fmt, tm, decided
      {
        /* A white space in the format string matches 0 more or white
           space in the input string.  */
 -      if (ISSPACE (*fmt))
 +      if (c_isspace (*fmt))
          {
 -          while (ISSPACE (*rp))
 +          while (c_isspace (*rp))
              ++rp;
            ++fmt;
            continue;
          case 'n':
          case 't':
            /* Match any white space.  */
 -          while (ISSPACE (*rp))
 +          while (c_isspace (*rp))
              ++rp;
            break;
          case 'p':
@@@ -1365,7 -1368,7 +1366,7 @@@ strtoll (const char *nptr, char **endpt
            nptr += 2;
            /* "0x" must be followed by at least one hex char.  If not,
               return 0 and place ENDPTR on 'x'. */
 -          if (!ISXDIGIT (*nptr))
 +          if (!c_isxdigit (*nptr))
              {
                --nptr;
                goto out;
diff --combined src/connect.c
index 19cca8235b63d650f5e0fe16467b7b177c22e7d5,0bf1a7f6fb9a46263771d9b9fe647e6f24422325..223e6a857f6a7325a91e93f693e3b31ed0c80038
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -50,6 -51,8 +51,6 @@@
  #ifdef HAVE_SYS_SELECT_H
  # include <sys/select.h>
  #endif /* HAVE_SYS_SELECT_H */
 -
 -#include "wget.h"
  #include "utils.h"
  #include "host.h"
  #include "connect.h"
diff --combined src/convert.c
index e706154d34c5d7e5556f43004ef2a3557db5105f,fcb0dc7d4f1383de67581f9e153461fdaa7f7f15..88474c6d5fd4f67168316ddc455098c8fb35fcff
@@@ -16,17 -16,18 +16,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -36,6 -37,8 +37,6 @@@
  #endif /* HAVE_UNISTD_H */
  #include <errno.h>
  #include <assert.h>
 -
 -#include "wget.h"
  #include "convert.h"
  #include "url.h"
  #include "recur.h"
diff --combined src/cookies.c
index 9045e83bcb4f7f835821115d0d571f8d14a22207,7534670fcd00ff5b34e8e3967202fe919acfb42a..6b8b7b7f5212d87ec4eaf6a250e115807f16baf0
@@@ -17,15 -17,16 +17,16 @@@ General Public License for more details
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
  /* Written by Hrvoje Niksic.  Parts are loosely inspired by the
     cookie patch submitted by Tomasz Wegrzanowski.
@@@ -42,7 -43,7 +43,7 @@@
     sites that do send Set-Cookie2 also emit Set-Cookie for
     compatibility.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <string.h>
@@@ -50,6 -51,8 +51,6 @@@
  #include <assert.h>
  #include <errno.h>
  #include <time.h>
 -
 -#include "wget.h"
  #include "utils.h"
  #include "hash.h"
  #include "cookies.h"
@@@ -454,9 -457,9 +455,9 @@@ parse_set_cookie (const char *set_cooki
  
  
  #define REQUIRE_DIGITS(p) do {                  \
 -  if (!ISDIGIT (*p))                            \
 +  if (!c_isdigit (*p))                            \
      return false;                               \
 -  for (++p; ISDIGIT (*p); p++)                  \
 +  for (++p; c_isdigit (*p); p++)                  \
      ;                                           \
  } while (0)
  
@@@ -1100,7 -1103,7 +1101,7 @@@ domain_port (const char *domain_b, cons
    const char *colon = memchr (domain_b, ':', domain_e - domain_b);
    if (!colon)
      return 0;
 -  for (p = colon + 1; p < domain_e && ISDIGIT (*p); p++)
 +  for (p = colon + 1; p < domain_e && c_isdigit (*p); p++)
      port = 10 * port + (*p - '0');
    if (p < domain_e)
      /* Garbage following port number. */
@@@ -1151,7 -1154,7 +1152,7 @@@ cookie_jar_load (struct cookie_jar *jar
        char *value_b   = NULL, *value_e   = NULL;
  
        /* Skip leading white-space. */
 -      while (*p && ISSPACE (*p))
 +      while (*p && c_isspace (*p))
          ++p;
        /* Ignore empty lines.  */
        if (!*p || *p == '#')
diff --combined src/ftp-basic.c
index 4e91a7e39e24f3184d8b61df99318f08ae3f291d,0f560765c38f8e582d04f2f9e02143ecb41e02ac..dd3ee3afa710c186c057f46b01ac6c58cb89f308
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <assert.h>
  #include <stdio.h>
@@@ -38,6 -39,8 +39,6 @@@
  #ifdef HAVE_UNISTD_H
  # include <unistd.h>
  #endif
 -
 -#include "wget.h"
  #include "utils.h"
  #include "connect.h"
  #include "host.h"
@@@ -80,7 -83,7 +81,7 @@@ ftp_response (int fd, char **ret_line
          DEBUGP (("%s\n", escnonprint (line)));
  
        /* The last line of output is the one that begins with "ddd ". */
 -      if (ISDIGIT (line[0]) && ISDIGIT (line[1]) && ISDIGIT (line[2])
 +      if (c_isdigit (line[0]) && c_isdigit (line[1]) && c_isdigit (line[2])
            && line[3] == ' ')
          {
            strncpy (ftp_last_respline, line, sizeof (ftp_last_respline));
@@@ -203,7 -206,7 +204,7 @@@ ftp_login (int csock, const char *acc, 
          int skey_sequence = 0;
  
          /* Extract the sequence from SEED.  */
 -        for (; ISDIGIT (*seed); seed++)
 +        for (; c_isdigit (*seed); seed++)
            skey_sequence = 10 * skey_sequence + *seed - '0';
          if (*seed == ' ')
            ++seed;
@@@ -519,14 -522,14 +520,14 @@@ ftp_pasv (int csock, ip_address *addr, 
      }
    /* Parse the request.  */
    s = respline;
 -  for (s += 4; *s && !ISDIGIT (*s); s++)
 +  for (s += 4; *s && !c_isdigit (*s); s++)
      ;
    if (!*s)
      return FTPINVPASV;
    for (i = 0; i < 6; i++)
      {
        tmp[i] = 0;
 -      for (; ISDIGIT (*s); s++)
 +      for (; c_isdigit (*s); s++)
          tmp[i] = (*s - '0') + 10 * tmp[i];
        if (*s == ',')
          s++;
@@@ -588,14 -591,14 +589,14 @@@ ftp_lpsv (int csock, ip_address *addr, 
  
    /* Parse the response.  */
    s = respline;
 -  for (s += 4; *s && !ISDIGIT (*s); s++)
 +  for (s += 4; *s && !c_isdigit (*s); s++)
      ;
    if (!*s)
      return FTPINVPASV;
  
    /* First, get the address family */
    af = 0;
 -  for (; ISDIGIT (*s); s++)
 +  for (; c_isdigit (*s); s++)
      af = (*s - '0') + 10 * af;
  
    if (af != 4 && af != 6)
  
    /* Then, get the address length */
    addrlen = 0;
 -  for (; ISDIGIT (*s); s++)
 +  for (; c_isdigit (*s); s++)
      addrlen = (*s - '0') + 10 * addrlen;
  
    if (!*s || *s++ != ',')
    for (i = 0; i < addrlen; i++)
      {
        tmp[i] = 0;
 -      for (; ISDIGIT (*s); s++)
 +      for (; c_isdigit (*s); s++)
          tmp[i] = (*s - '0') + 10 * tmp[i];
        if (*s == ',')
          s++;
  
    /* Now, get the port length */
    portlen = 0;
 -  for (; ISDIGIT (*s); s++)
 +  for (; c_isdigit (*s); s++)
      portlen = (*s - '0') + 10 * portlen;
  
    if (!*s || *s++ != ',')
  
    /* Finally, we get the port number */
    tmpprt[0] = 0;
 -  for (; ISDIGIT (*s); s++)
 +  for (; c_isdigit (*s); s++)
      tmpprt[0] = (*s - '0') + 10 * tmpprt[0];
  
    if (!*s || *s++ != ',')
      }
  
    tmpprt[1] = 0;
 -  for (; ISDIGIT (*s); s++)
 +  for (; c_isdigit (*s); s++)
      tmpprt[1] = (*s - '0') + 10 * tmpprt[1];
  
    assert (s != NULL);
@@@ -784,7 -787,7 +785,7 @@@ ftp_epsv (int csock, ip_address *ip, in
  
    /* Finally, get the port number */
    tport = 0; 
 -  for (i = 1; ISDIGIT (*s); s++) 
 +  for (i = 1; c_isdigit (*s); s++) 
      {
        if (i > 5)
          {
@@@ -1169,7 -1172,7 +1170,7 @@@ ftp_process_type (const char *params
    if (params
        && 0 == strncasecmp (params, "type=", 5)
        && params[5] != '\0')
 -    return TOUPPER (params[5]);
 +    return c_toupper (params[5]);
    else
      return 'I';
  }
diff --combined src/ftp-ls.c
index 35350bb1bbb6a70ea1993ac423475bcc3407158f,fb1537e26eef559b724b28b1a5493f238c2974d3..ac4786b536236bdddea12691c9d51c9a758aa8a1
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -37,6 -38,8 +38,6 @@@
  #endif
  #include <errno.h>
  #include <time.h>
 -
 -#include "wget.h"
  #include "utils.h"
  #include "ftp.h"
  #include "url.h"
@@@ -250,10 -253,10 +251,10 @@@ ftp_parse_unix_ls (const char *file, in
                year = 0;
                min = hour = sec = 0;
                /* We must deal with digits.  */
 -              if (ISDIGIT (*tok))
 +              if (c_isdigit (*tok))
                  {
                    /* Suppose it's year.  */
 -                  for (; ISDIGIT (*tok); tok++)
 +                  for (; c_isdigit (*tok); tok++)
                      year = (*tok - '0') + 10 * year;
                    if (*tok == ':')
                      {
                        year = 0;
                        ++tok;
                        /* Get the minutes...  */
 -                      for (; ISDIGIT (*tok); tok++)
 +                      for (; c_isdigit (*tok); tok++)
                          min = (*tok - '0') + 10 * min;
                        if (*tok == ':')
                          {
                            /* ...and the seconds.  */
                            ++tok;
 -                          for (; ISDIGIT (*tok); tok++)
 +                          for (; c_isdigit (*tok); tok++)
                              sec = (*tok - '0') + 10 * sec;
                          }
                      }
diff --combined src/ftp-opie.c
index 713e14c07212c6ae88098f2560fac63c3403cf98,a9986174a6094db9b2da043f910e4b317dc6fe5c..eba6310cf54196258a9ac34a6a7f8666e56ed98e
@@@ -17,22 -17,24 +17,23 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  
 -#include "wget.h"
  #include "gen-md5.h"
  #include "ftp.h"
  
diff --combined src/ftp.c
index 04d240764bbe2d03c9d8e5daec55ea68c753dadb,a0b22c14945ccdfb0c32aa6552b65ec49f696ce7..a9ff9437a2f343be1be6bb2f04d539afe87b0eec
+++ b/src/ftp.c
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -39,6 -40,7 +40,6 @@@
  #include <errno.h>
  #include <time.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "url.h"
  #include "retr.h"
  #include "recur.h"              /* for INFINITE_RECURSION */
  
  /* File where the "ls -al" listing will be saved.  */
 +#ifdef MSDOS
 +#define LIST_FILENAME "_listing"
 +#else
  #define LIST_FILENAME ".listing"
 +#endif
  
  typedef struct
  {
@@@ -87,11 -85,11 +88,11 @@@ ftp_expected_bytes (const char *s
        res = str_to_wgint (s, (char **) &s, 10);
        if (!*s)
          return 0;
 -      while (*s && ISSPACE (*s))
 +      while (*s && c_isspace (*s))
          ++s;
        if (!*s)
          return 0;
 -      if (TOLOWER (*s) != 'b')
 +      if (c_tolower (*s) != 'b')
          continue;
        if (strncasecmp (s, "byte", 4))
          continue;
@@@ -495,7 -493,7 +496,7 @@@ Error in server response, closing contr
  
            if (target[0] != '/'
                && !(con->rs != ST_UNIX
 -                   && ISALPHA (target[0])
 +                   && c_isalpha (target[0])
                     && target[1] == ':')
                && con->rs != ST_OS400)
              {
diff --combined src/gen-md5.c
index 1e97277b04444236ac8fbaa193b66ac5fa5f8e2a,0c105fa0abde0d7249e26e9a705bb1cb129fb6f8..6533127b75ad84af9d3b8f8a5ebee3d912f6021c
@@@ -17,22 -17,24 +17,23 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
  #include "wget.h"
  
  #include "gen-md5.h"
  
  #ifdef HAVE_BUILTIN_MD5
 -# include <gnu-md5.h>
 +# include <md5.h>
  typedef struct md5_ctx gen_md5_context_imp;
  #endif
  
diff --combined src/gnutls.c
index a7c253f1b3e6678acf2348a68476cdaba008dad5,7f0153e553b94c4112ce8c67802afbbc47dd20d9..05ae086b5c0da203afe6dfd5ebfc987d76293530
@@@ -16,17 -16,18 +16,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <assert.h>
  #include <errno.h>
@@@ -39,6 -40,7 +40,6 @@@
  #include <gnutls/gnutls.h>
  #include <gnutls/x509.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "connect.h"
  #include "url.h"
diff --combined src/hash.c
index e3fac111bf85d318b5d7736a122ca33bf2b5ee21,b5acfc2238aeb699349fb06d27b1762ca48b7509..7740b32876522e7a411ee4f21dff5e51d0eeadff
@@@ -17,21 -17,22 +17,22 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
  /* With -DSTANDALONE, this file can be compiled outside Wget source
     tree.  To test, also use -DTEST.  */
  
 -#ifdef HAVE_CONFIG_H
 -# include <config.h>
 +#ifndef STANDALONE
 +# include "wget.h"
  #endif
  
  #include <stdio.h>
@@@ -42,6 -43,7 +43,6 @@@
  
  #ifndef STANDALONE
  /* Get Wget's utility headers. */
 -# include "wget.h"
  # include "utils.h"
  #else
  /* Make do without them. */
@@@ -53,7 -55,7 +54,7 @@@
  #  define countof(x) (sizeof (x) / sizeof ((x)[0]))
  # endif
  # include <ctype.h>
 -# define TOLOWER(x) tolower ((unsigned char) (x))
 +# define c_tolower(x) tolower ((unsigned char) (x))
  # if __STDC_VERSION__ >= 199901L
  #  include <stdint.h>  /* for uintptr_t */
  # else
@@@ -679,11 -681,11 +680,11 @@@ static unsigned lon
  hash_string_nocase (const void *key)
  {
    const char *p = key;
 -  unsigned int h = TOLOWER (*p);
 +  unsigned int h = c_tolower (*p);
    
    if (h)
      for (p += 1; *p != '\0'; p++)
 -      h = (h << 5) - h + TOLOWER (*p);
 +      h = (h << 5) - h + c_tolower (*p);
    
    return h;
  }
diff --combined src/host.c
index 60da2541bc8d01e2d68543d9ff6ca53d14a04b08,863209f395439b86bd2aa2b3040409437fa0ee65..d915393c398a6e13ddc243caf5090bd9e22f2869
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -48,6 -49,7 +49,6 @@@
  
  #include <errno.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "host.h"
  #include "url.h"
@@@ -494,7 -496,7 +495,7 @@@ is_valid_ipv6_address (const char *str
        int ch = *str++;
  
        /* if ch is a number, add it to val. */
 -      if (ISXDIGIT (ch))
 +      if (c_isxdigit (ch))
          {
            val <<= 4;
            val |= XDIGIT_TO_NUM (ch);
@@@ -847,7 -849,7 +848,7 @@@ sufmatch (const char **list, const cha
    for (i = 0; list[i]; i++)
      {
        for (j = strlen (list[i]), k = lw; j >= 0 && k >= 0; j--, k--)
 -        if (TOLOWER (list[i][j]) != TOLOWER (what[k]))
 +        if (c_tolower (list[i][j]) != c_tolower (what[k]))
            break;
        /* The domain must be first to reach to beginning.  */
        if (j == -1)
diff --combined src/html-parse.c
index b98843e38ccf8c11c76bc975ca87c01d0ae39a4a,2e7465a42c9b437e364d55dcfb77aa3d71d3c712..55d5d9156265623e415b2cf31f2af750ced6881d
@@@ -17,15 -17,16 +17,16 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
  /* The only entry point to this module is map_html_tags(), which see.  */
  
@@@ -88,7 -89,7 +89,7 @@@
  /* To test as standalone, compile with `-DSTANDALONE -I.'.  You'll
     still need Wget headers to compile.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #ifdef STANDALONE
  # define I_REALLY_WANT_CTYPE_MACROS
  #include <string.h>
  #include <assert.h>
  
 -#include "wget.h"
  #include "html-parse.h"
  
  #ifdef STANDALONE
  # define xrealloc realloc
  # define xfree free
  
 -# undef ISSPACE
 -# undef ISDIGIT
 -# undef ISXDIGIT
 -# undef ISALPHA
 -# undef ISALNUM
 -# undef TOLOWER
 -# undef TOUPPER
 -
 -# define ISSPACE(x) isspace (x)
 -# define ISDIGIT(x) isdigit (x)
 -# define ISXDIGIT(x) isxdigit (x)
 -# define ISALPHA(x) isalpha (x)
 -# define ISALNUM(x) isalnum (x)
 -# define TOLOWER(x) tolower (x)
 -# define TOUPPER(x) toupper (x)
 +# undef c_isspace
 +# undef c_isdigit
 +# undef c_isxdigit
 +# undef c_isalpha
 +# undef c_isalnum
 +# undef c_tolower
 +# undef c_toupper
 +
 +# define c_isspace(x) isspace (x)
 +# define c_isdigit(x) isdigit (x)
 +# define c_isxdigit(x) isxdigit (x)
 +# define c_isalpha(x) isalpha (x)
 +# define c_isalnum(x) isalnum (x)
 +# define c_tolower(x) tolower (x)
 +# define c_toupper(x) toupper (x)
  
  struct hash_table {
    int dummy;
@@@ -257,7 -259,7 +258,7 @@@ struct pool 
     However, "&lt;foo" will work, as will "&lt!foo", "&lt", etc.  In
     other words an entity needs to be terminated by either a
     non-alphanumeric or the end of string.  */
 -#define FITS(p, n) (p + n == end || (p + n < end && !ISALNUM (p[n])))
 +#define FITS(p, n) (p + n == end || (p + n < end && !c_isalnum (p[n])))
  
  /* Macros that test entity names by returning true if P is followed by
     the specified characters.  */
@@@ -295,10 -297,10 +296,10 @@@ decode_entity (const char **ptr, const 
          int digits = 0;
          value = 0;
          if (*p == 'x')
 -          for (++p; value < 256 && p < end && ISXDIGIT (*p); p++, digits++)
 +          for (++p; value < 256 && p < end && c_isxdigit (*p); p++, digits++)
              value = (value << 4) + XDIGIT_TO_NUM (*p);
          else
 -          for (; value < 256 && p < end && ISDIGIT (*p); p++, digits++)
 +          for (; value < 256 && p < end && c_isdigit (*p); p++, digits++)
              value = (value * 10) + (*p - '0');
          if (!digits)
            return -1;
@@@ -367,9 -369,9 +368,9 @@@ convert_and_copy (struct pool *pool, co
       `&#32;'.  */
    if (flags & AP_TRIM_BLANKS)
      {
 -      while (beg < end && ISSPACE (*beg))
 +      while (beg < end && c_isspace (*beg))
          ++beg;
 -      while (end > beg && ISSPACE (end[-1]))
 +      while (end > beg && c_isspace (end[-1]))
          --end;
      }
  
      {
        char *p = pool->contents + old_tail;
        for (; *p; p++)
 -        *p = TOLOWER (*p);
 +        *p = c_tolower (*p);
      }
  }
  \f
@@@ -704,7 -706,7 +705,7 @@@ name_allowed (const struct hash_table *
  /* Skip whitespace, if any. */
  
  #define SKIP_WS(p) do {                         \
 -  while (ISSPACE (*p)) {                        \
 +  while (c_isspace (*p)) {                        \
      ADVANCE (p);                                \
    }                                             \
  } while (0)
  /* Skip non-whitespace, if any. */
  
  #define SKIP_NON_WS(p) do {                     \
 -  while (!ISSPACE (*p)) {                       \
 +  while (!c_isspace (*p)) {                       \
      ADVANCE (p);                                \
    }                                             \
  } while (0)
@@@ -935,7 -937,7 +936,7 @@@ map_html_tags (const char *text, int si
                     violated by, for instance, `%' in `width=75%'.
                     We'll be liberal and allow just about anything as
                     an attribute value.  */
 -                while (!ISSPACE (*p) && *p != '>')
 +                while (!c_isspace (*p) && *p != '>')
                    ADVANCE (p);
                  attr_value_end = p; /* <foo bar=baz qux=quix> */
                                      /*             ^          */
diff --combined src/html-url.c
index 3ab7f7fe02127410bf8f3781874cf74fc701e203,97fa1e56eb0e2cdedc61548257b571aaa6f1deb1..8a64d6956a2728c565a49876b9d7efd666ffd044
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <string.h>
@@@ -35,6 -36,7 +36,6 @@@
  #include <errno.h>
  #include <assert.h>
  
 -#include "wget.h"
  #include "html-parse.h"
  #include "url.h"
  #include "utils.h"
@@@ -508,20 -510,20 +509,20 @@@ tag_handle_meta (int tagid, struct tagi
        if (!refresh)
          return;
  
 -      for (p = refresh; ISDIGIT (*p); p++)
 +      for (p = refresh; c_isdigit (*p); p++)
          timeout = 10 * timeout + *p - '0';
        if (*p++ != ';')
          return;
  
 -      while (ISSPACE (*p))
 +      while (c_isspace (*p))
          ++p;
 -      if (!(   TOUPPER (*p)       == 'U'
 -            && TOUPPER (*(p + 1)) == 'R'
 -            && TOUPPER (*(p + 2)) == 'L'
 +      if (!(   c_toupper (*p)       == 'U'
 +            && c_toupper (*(p + 1)) == 'R'
 +            && c_toupper (*(p + 2)) == 'L'
              &&          *(p + 3)  == '='))
          return;
        p += 4;
 -      while (ISSPACE (*p))
 +      while (c_isspace (*p))
          ++p;
  
        entry = append_url (p, tag, attrind, ctx);
@@@ -667,9 -669,9 +668,9 @@@ get_urls_file (const char *file
        text = line_end;
  
        /* Strip whitespace from the beginning and end of line. */
 -      while (line_beg < line_end && ISSPACE (*line_beg))
 +      while (line_beg < line_end && c_isspace (*line_beg))
          ++line_beg;
 -      while (line_end > line_beg && ISSPACE (*(line_end - 1)))
 +      while (line_end > line_beg && c_isspace (*(line_end - 1)))
          --line_end;
  
        if (line_beg == line_end)
diff --combined src/http-ntlm.c
index 6109ed9debed9cb2acbac2222d6ab8ce7362ae8b,976498a3f13e96e894ddd11e5acc9e4a6fc48e1c..4893e043078b06394fa8ab2fc0cfed4fb6fb6108
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  /* NTLM details:
     
@@@ -42,8 -43,8 +43,8 @@@
  
  #include <openssl/des.h>
  #include <openssl/md4.h>
 +#include <openssl/opensslv.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "http-ntlm.h"
  
@@@ -120,7 -121,7 +121,7 @@@ ntlm_input (struct ntlmdata *ntlm, cons
      return false;
  
    header += 4;
 -  while (*header && ISSPACE(*header))
 +  while (*header && c_isspace(*header))
      header++;
  
    if (*header)
@@@ -246,7 -247,7 +247,7 @@@ mkhash(const char *password
      len = 14;
    
    for (i=0; i<len; i++)
 -    pw[i] = TOUPPER (password[i]);
 +    pw[i] = c_toupper (password[i]);
  
    for (; i<14; i++)
      pw[i] = 0;
diff --combined src/http.c
index 5a746da4d825d33e11faff6bd7b10d43a0e86143,0c5ef2acd9c4c63298443e6b51d01621405af7a2..717bb46ee4377b28054644e7ae07b4864e4deb1e
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -40,6 -41,7 +41,6 @@@
  #include <time.h>
  #include <locale.h>
  
 -#include "wget.h"
  #include "hash.h"
  #include "http.h"
  #include "utils.h"
@@@ -278,7 -280,7 +279,7 @@@ request_set_user_header (struct reques
      return;
    BOUNDED_TO_ALLOCA (header, p, name);
    ++p;
 -  while (ISSPACE (*p))
 +  while (c_isspace (*p))
      ++p;
    request_set_header (req, xstrdup (name), (char *) p, rel_name);
  }
@@@ -652,9 -654,9 +653,9 @@@ resp_header_locate (const struct respon
            && 0 == strncasecmp (b, name, name_len))
          {
            b += name_len + 1;
 -          while (b < e && ISSPACE (*b))
 +          while (b < e && c_isspace (*b))
              ++b;
 -          while (b < e && ISSPACE (e[-1]))
 +          while (b < e && c_isspace (e[-1]))
              --e;
            *begptr = b;
            *endptr = e;
@@@ -753,17 -755,17 +754,17 @@@ resp_status (const struct response *res
    if (p < end && *p == '/')
      {
        ++p;
 -      while (p < end && ISDIGIT (*p))
 +      while (p < end && c_isdigit (*p))
          ++p;
        if (p < end && *p == '.')
          ++p; 
 -      while (p < end && ISDIGIT (*p))
 +      while (p < end && c_isdigit (*p))
          ++p;
      }
  
 -  while (p < end && ISSPACE (*p))
 +  while (p < end && c_isspace (*p))
      ++p;
 -  if (end - p < 3 || !ISDIGIT (p[0]) || !ISDIGIT (p[1]) || !ISDIGIT (p[2]))
 +  if (end - p < 3 || !c_isdigit (p[0]) || !c_isdigit (p[1]) || !c_isdigit (p[2]))
      return -1;
  
    status = 100 * (p[0] - '0') + 10 * (p[1] - '0') + (p[2] - '0');
  
    if (message)
      {
 -      while (p < end && ISSPACE (*p))
 +      while (p < end && c_isspace (*p))
          ++p;
 -      while (p < end && ISSPACE (end[-1]))
 +      while (p < end && c_isspace (end[-1]))
          --end;
        *message = strdupdelim (p, end);
      }
@@@ -844,26 -846,26 +845,26 @@@ parse_content_range (const char *hdr, w
           HTTP spec. */
        if (*hdr == ':')
          ++hdr;
 -      while (ISSPACE (*hdr))
 +      while (c_isspace (*hdr))
          ++hdr;
        if (!*hdr)
          return false;
      }
 -  if (!ISDIGIT (*hdr))
 +  if (!c_isdigit (*hdr))
      return false;
 -  for (num = 0; ISDIGIT (*hdr); hdr++)
 +  for (num = 0; c_isdigit (*hdr); hdr++)
      num = 10 * num + (*hdr - '0');
 -  if (*hdr != '-' || !ISDIGIT (*(hdr + 1)))
 +  if (*hdr != '-' || !c_isdigit (*(hdr + 1)))
      return false;
    *first_byte_ptr = num;
    ++hdr;
 -  for (num = 0; ISDIGIT (*hdr); hdr++)
 +  for (num = 0; c_isdigit (*hdr); hdr++)
      num = 10 * num + (*hdr - '0');
 -  if (*hdr != '/' || !ISDIGIT (*(hdr + 1)))
 +  if (*hdr != '/' || !c_isdigit (*(hdr + 1)))
      return false;
    *last_byte_ptr = num;
    ++hdr;
 -  for (num = 0; ISDIGIT (*hdr); hdr++)
 +  for (num = 0; c_isdigit (*hdr); hdr++)
      num = 10 * num + (*hdr - '0');
    *entity_length_ptr = num;
    return true;
@@@ -938,7 -940,7 +939,7 @@@ extract_param (const char **source, par
  {
    const char *p = *source;
  
 -  while (ISSPACE (*p)) ++p;
 +  while (c_isspace (*p)) ++p;
    if (!*p)
      {
        *source = p;
  
    /* Extract name. */
    name->b = p;
 -  while (*p && !ISSPACE (*p) && *p != '=' && *p != separator) ++p;
 +  while (*p && !c_isspace (*p) && *p != '=' && *p != separator) ++p;
    name->e = p;
    if (name->b == name->e)
      return false;               /* empty name: error */
 -  while (ISSPACE (*p)) ++p;
 +  while (c_isspace (*p)) ++p;
    if (*p == separator || !*p)           /* no value */
      {
        xzero (*value);
  
    /* *p is '=', extract value */
    ++p;
 -  while (ISSPACE (*p)) ++p;
 +  while (c_isspace (*p)) ++p;
    if (*p == '"')                /* quoted */
      {
        value->b = ++p;
          return false;
        value->e = p++;
        /* Currently at closing quote; find the end of param. */
 -      while (ISSPACE (*p)) ++p;
 +      while (c_isspace (*p)) ++p;
        while (*p && *p != separator) ++p;
        if (*p == separator)
          ++p;
        value->b = p;
        while (*p && *p != separator) ++p;
        value->e = p;
 -      while (value->e != value->b && ISSPACE (value->e[-1]))
 +      while (value->e != value->b && c_isspace (value->e[-1]))
          --value->e;
        if (*p == separator) ++p;
      }
@@@ -1314,7 -1316,7 +1315,7 @@@ free_hstat (struct http_stat *hs
  
  #define BEGINS_WITH(line, string_constant)                               \
    (!strncasecmp (line, string_constant, sizeof (string_constant) - 1)    \
 -   && (ISSPACE (line[sizeof (string_constant) - 1])                      \
 +   && (c_isspace (line[sizeof (string_constant) - 1])                      \
         || !line[sizeof (string_constant) - 1]))
  
  #define SET_USER_AGENT(req) do {                                         \
@@@ -2020,7 -2022,7 +2021,7 @@@ File `%s' already there; not retrieving
        char *tmp = strchr (type, ';');
        if (tmp)
          {
 -          while (tmp > type && ISSPACE (tmp[-1]))
 +          while (tmp > type && c_isspace (tmp[-1]))
              --tmp;
            *tmp = '\0';
          }
@@@ -2544,7 -2546,7 +2545,7 @@@ Remote file does not exist -- broken li
        /* Did we get the time-stamp? */
        if (!got_head)
          {
 -          bool restart_loop = false;
 +          got_head = true;    /* no more time-stamping */
  
            if (opt.timestamping && !hstat.remote_time)
              {
@@@ -2562,87 -2564,92 +2563,87 @@@ Last-modified header invalid -- time-st
                  time_came_from_head = true;
              }
        
 -          /* The time-stamping section.  */
 -          if (opt.timestamping)
 +          if (send_head_first)
              {
 -              if (hstat.orig_file_name) /* Perform the following checks only 
 -                                           if the file we're supposed to 
 -                                           download already exists. */
 +              /* The time-stamping section.  */
 +              if (opt.timestamping)
                  {
 -                  if (hstat.remote_time && 
 -                      tmr != (time_t) (-1))
 +                  if (hstat.orig_file_name) /* Perform the following
 +                                               checks only if the file
 +                                               we're supposed to
 +                                               download already exists.  */
                      {
 -                      /* Now time-stamping can be used validly.  Time-stamping
 -                         means that if the sizes of the local and remote file
 -                         match, and local file is newer than the remote file,
 -                         it will not be retrieved.  Otherwise, the normal
 -                         download procedure is resumed.  */
 -                      if (hstat.orig_file_tstamp >= tmr)
 +                      if (hstat.remote_time && 
 +                          tmr != (time_t) (-1))
                          {
 -                          if (hstat.contlen == -1 
 -                              || hstat.orig_file_size == hstat.contlen)
 +                          /* Now time-stamping can be used validly.
 +                             Time-stamping means that if the sizes of
 +                             the local and remote file match, and local
 +                             file is newer than the remote file, it will
 +                             not be retrieved.  Otherwise, the normal
 +                             download procedure is resumed.  */
 +                          if (hstat.orig_file_tstamp >= tmr)
                              {
 -                              logprintf (LOG_VERBOSE, _("\
 +                              if (hstat.contlen == -1 
 +                                  || hstat.orig_file_size == hstat.contlen)
 +                                {
 +                                  logprintf (LOG_VERBOSE, _("\
  Server file no newer than local file `%s' -- not retrieving.\n\n"),
 -                                         hstat.orig_file_name);
 -                              ret = RETROK;
 -                              goto exit;
 -                            }
 -                          else
 -                            {
 -                              logprintf (LOG_VERBOSE, _("\
 +                                             hstat.orig_file_name);
 +                                  ret = RETROK;
 +                                  goto exit;
 +                                }
 +                              else
 +                                {
 +                                  logprintf (LOG_VERBOSE, _("\
  The sizes do not match (local %s) -- retrieving.\n"),
 -                                         number_to_static_string (hstat.orig_file_size));
 +                                             number_to_static_string (hstat.orig_file_size));
 +                                }
                              }
 -                        }
 -                      else
 -                        logputs (LOG_VERBOSE,
 -                                 _("Remote file is newer, retrieving.\n"));
 +                          else
 +                            logputs (LOG_VERBOSE,
 +                                     _("Remote file is newer, retrieving.\n"));
  
 -                      logputs (LOG_VERBOSE, "\n");
 +                          logputs (LOG_VERBOSE, "\n");
 +                        }
                      }
 +                  
 +                  /* free_hstat (&hstat); */
 +                  hstat.timestamp_checked = true;
                  }
                
 -              /* free_hstat (&hstat); */
 -              hstat.timestamp_checked = true;
 -              restart_loop = true;
 -            }
 -          
 -          if (opt.spider)
 -            {
 -              if (opt.recursive)
 +              if (opt.spider)
                  {
 -                  if (*dt & TEXTHTML)
 +                  if (opt.recursive)
                      {
 -                      logputs (LOG_VERBOSE, _("\
 +                      if (*dt & TEXTHTML)
 +                        {
 +                          logputs (LOG_VERBOSE, _("\
  Remote file exists and could contain links to other resources -- retrieving.\n\n"));
 -                      restart_loop = true;
 +                        }
 +                      else 
 +                        {
 +                          logprintf (LOG_VERBOSE, _("\
 +Remote file exists but does not contain any link -- not retrieving.\n\n"));
 +                          ret = RETROK; /* RETRUNNEEDED is not for caller. */
 +                          goto exit;
 +                        }
                      }
 -                  else 
 +                  else
                      {
                        logprintf (LOG_VERBOSE, _("\
 -Remote file exists but does not contain any link -- not retrieving.\n\n"));
 +Remote file exists but recursion is disabled -- not retrieving.\n\n"));
                        ret = RETROK; /* RETRUNNEEDED is not for caller. */
                        goto exit;
                      }
                  }
 -              else
 -                {
 -                  logprintf (LOG_VERBOSE, _("\
 -Remote file exists but recursion is disabled -- not retrieving.\n\n"));
 -                  ret = RETROK; /* RETRUNNEEDED is not for caller. */
 -                  goto exit;
 -                }
 -            }
  
 -          if (send_head_first)
 -            {
                got_name = true;
 -              restart_loop = true;
 -            }
 -          
 -          got_head = true;    /* no more time-stamping */
 -          *dt &= ~HEAD_ONLY;
 -          count = 0;          /* the retrieve count for HEAD is reset */
 -
 -          if (restart_loop) 
 -            continue;
 -        }
 +              *dt &= ~HEAD_ONLY;
 +              count = 0;          /* the retrieve count for HEAD is reset */
 +              continue;
 +            } /* send_head_first */
 +        } /* !got_head */
            
        if ((tmr != (time_t) (-1))
            && ((hstat.len == hstat.contlen) ||
@@@ -2795,11 -2802,11 +2796,11 @@@ check_end (const char *p
  {
    if (!p)
      return false;
 -  while (ISSPACE (*p))
 +  while (c_isspace (*p))
      ++p;
    if (!*p
        || (p[0] == 'G' && p[1] == 'M' && p[2] == 'T')
 -      || ((p[0] == '+' || p[0] == '-') && ISDIGIT (p[1])))
 +      || ((p[0] == '+' || p[0] == '-') && c_isdigit (p[1])))
      return true;
    else
      return false;
@@@ -2915,7 -2922,7 +2916,7 @@@ basic_authentication_encode (const cha
  }
  
  #define SKIP_WS(x) do {                         \
 -  while (ISSPACE (*(x)))                        \
 +  while (c_isspace (*(x)))                        \
      ++(x);                                      \
  } while (0)
  
@@@ -3047,7 -3054,7 +3048,7 @@@ username=\"%s\", realm=\"%s\", nonce=\"
    ((e) - (b) >= STRSIZE (literal)                       \
     && 0 == strncasecmp (b, literal, STRSIZE (literal))  \
     && ((e) - (b) == STRSIZE (literal)                   \
 -       || ISSPACE (b[STRSIZE (literal)])))
 +       || c_isspace (b[STRSIZE (literal)])))
  
  static bool
  known_authentication_scheme_p (const char *hdrbeg, const char *hdrend)
@@@ -3076,7 -3083,7 +3077,7 @@@ create_authorization_line (const char *
  {
    /* We are called only with known schemes, so we can dispatch on the
       first letter. */
 -  switch (TOUPPER (*au))
 +  switch (c_toupper (*au))
      {
      case 'B':                   /* Basic */
        *finished = true;
diff --combined src/init.c
index 71a5ecec8f92a60aaf2a22204737afe255c5e659,534ed63ee658216fa84ba41a69d53e94899309ef..edf36dfd3c10faafeccc8f405b3ee1c0a922055a
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -42,6 -43,7 +43,6 @@@
  #endif
  #include <assert.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "init.h"
  #include "host.h"
@@@ -575,9 -577,9 +576,9 @@@ parse_line (const char *line, char **co
    int ind;
  
    /* Skip leading and trailing whitespace.  */
 -  while (*line && ISSPACE (*line))
 +  while (*line && c_isspace (*line))
      ++line;
 -  while (end > line && ISSPACE (end[-1]))
 +  while (end > line && c_isspace (end[-1]))
      --end;
  
    /* Skip empty lines and comments.  */
    p = line;
  
    cmdstart = p;
 -  while (p < end && (ISALNUM (*p) || *p == '_' || *p == '-'))
 +  while (p < end && (c_isalnum (*p) || *p == '_' || *p == '-'))
      ++p;
    cmdend = p;
  
    /* Skip '=', as well as any space before or after it. */
 -  while (p < end && ISSPACE (*p))
 +  while (p < end && c_isspace (*p))
      ++p;
    if (p == end || *p != '=')
      return line_syntax_error;
    ++p;
 -  while (p < end && ISSPACE (*p))
 +  while (p < end && c_isspace (*p))
      ++p;
  
    valstart = p;
@@@ -690,15 -692,15 +691,15 @@@ static bool decode_string (const char *
  static bool simple_atoi (const char *, const char *, int *);
  static bool simple_atof (const char *, const char *, double *);
  
 -#define CMP1(p, c0) (TOLOWER((p)[0]) == (c0) && (p)[1] == '\0')
 +#define CMP1(p, c0) (c_tolower((p)[0]) == (c0) && (p)[1] == '\0')
  
 -#define CMP2(p, c0, c1) (TOLOWER((p)[0]) == (c0)        \
 -                         && TOLOWER((p)[1]) == (c1)     \
 +#define CMP2(p, c0, c1) (c_tolower((p)[0]) == (c0)        \
 +                         && c_tolower((p)[1]) == (c1)     \
                           && (p)[2] == '\0')
  
 -#define CMP3(p, c0, c1, c2) (TOLOWER((p)[0]) == (c0)    \
 -                     && TOLOWER((p)[1]) == (c1)         \
 -                     && TOLOWER((p)[2]) == (c2)         \
 +#define CMP3(p, c0, c1, c2) (c_tolower((p)[0]) == (c0)    \
 +                     && c_tolower((p)[1]) == (c1)         \
 +                     && c_tolower((p)[2]) == (c2)         \
                       && (p)[3] == '\0')
  
  
@@@ -906,12 -908,12 +907,12 @@@ parse_bytes_helper (const char *val, do
      }
  
    /* Strip trailing whitespace.  */
 -  while (val < end && ISSPACE (end[-1]))
 +  while (val < end && c_isspace (end[-1]))
      --end;
    if (val == end)
      return false;
  
 -  switch (TOLOWER (end[-1]))
 +  switch (c_tolower (end[-1]))
      {
      case 'k':
        --end, mult = 1024.0;
      }
  
    /* Skip leading and trailing whitespace. */
 -  while (val < end && ISSPACE (*val))
 +  while (val < end && c_isspace (*val))
      ++val;
 -  while (val < end && ISSPACE (end[-1]))
 +  while (val < end && c_isspace (end[-1]))
      --end;
    if (val == end)
      return false;
@@@ -1004,7 -1006,7 +1005,7 @@@ cmd_time (const char *com, const char *
    const char *end = val + strlen (val);
  
    /* Strip trailing whitespace.  */
 -  while (val < end && ISSPACE (end[-1]))
 +  while (val < end && c_isspace (end[-1]))
      --end;
  
    if (val == end)
        return false;
      }
  
 -  switch (TOLOWER (end[-1]))
 +  switch (c_tolower (end[-1]))
      {
      case 's':
        --end, mult = 1;          /* seconds */
      }
  
    /* Skip leading and trailing whitespace. */
 -  while (val < end && ISSPACE (*val))
 +  while (val < end && c_isspace (*val))
      ++val;
 -  while (val < end && ISSPACE (end[-1]))
 +  while (val < end && c_isspace (end[-1]))
      --end;
    if (val == end)
      goto err;
@@@ -1320,7 -1322,7 +1321,7 @@@ simple_atoi (const char *beg, const cha
    bool negative = false;
    const char *p = beg;
  
 -  while (p < end && ISSPACE (*p))
 +  while (p < end && c_isspace (*p))
      ++p;
    if (p < end && (*p == '-' || *p == '+'))
      {
       negative integer cannot be represented as a positive number.  */
  
    if (!negative)
 -    for (; p < end && ISDIGIT (*p); p++)
 +    for (; p < end && c_isdigit (*p); p++)
        {
          int next = (10 * result) + (*p - '0');
          if (next < result)
          result = next;
        }
    else
 -    for (; p < end && ISDIGIT (*p); p++)
 +    for (; p < end && c_isdigit (*p); p++)
        {
          int next = (10 * result) - (*p - '0');
          if (next > result)
@@@ -1374,7 -1376,7 +1375,7 @@@ simple_atof (const char *beg, const cha
  
    const char *p = beg;
  
 -  while (p < end && ISSPACE (*p))
 +  while (p < end && c_isspace (*p))
      ++p;
    if (p < end && (*p == '-' || *p == '+'))
      {
    for (; p < end; p++)
      {
        char ch = *p;
 -      if (ISDIGIT (ch))
 +      if (c_isdigit (ch))
          {
            if (!seen_dot)
              result = (10 * result) + (ch - '0');
@@@ -1421,7 -1423,7 +1422,7 @@@ check_user_specified_header (const cha
  {
    const char *p;
  
 -  for (p = s; *p && *p != ':' && !ISSPACE (*p); p++)
 +  for (p = s; *p && *p != ':' && !c_isspace (*p); p++)
      ;
    /* The header MUST contain `:' preceded by at least one
       non-whitespace character.  */
diff --combined src/log.c
index 357925d3d1c2814b33e3d779546014c2269b3656,e448c1412bbd1d0e850dc87f512112fe888d5c5c..a9007fddacfc46ea11c05c51d2564a22b6ff8145
+++ b/src/log.c
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <string.h>
@@@ -39,6 -40,7 +40,6 @@@
  #include <assert.h>
  #include <errno.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "log.h"
  
@@@ -595,7 -597,7 +596,7 @@@ log_dump_context (void
  /* String escape functions. */
  
  /* Return the number of non-printable characters in SOURCE.
 -   Non-printable characters are determined as per safe-ctype.c.  */
 +   Non-printable characters are determined as per c-ctype.c.  */
  
  static int
  count_nonprint (const char *source)
    const char *p;
    int cnt;
    for (p = source, cnt = 0; *p; p++)
 -    if (!ISPRINT (*p))
 +    if (!c_isprint (*p))
        ++cnt;
    return cnt;
  }
@@@ -643,7 -645,7 +644,7 @@@ copy_and_escape (const char *source, ch
      {
      case 8:
        while ((c = *from++) != '\0')
 -        if (ISPRINT (c))
 +        if (c_isprint (c))
            *to++ = c;
          else
            {
        break;
      case 16:
        while ((c = *from++) != '\0')
 -        if (ISPRINT (c))
 +        if (c_isprint (c))
            *to++ = c;
          else
            {
diff --combined src/main.c
index caecd6a4b7f0d66fff4334f0fae494091a9767a9,2c30843007fe500b4d976d6c0a04c1478e13a7ef..d2a55c51cb1e82a8fad90e46f3d95a7890f4eef7
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
  #endif /* HAVE_UNISTD_H */
  #include <string.h>
  #include <signal.h>
 -#ifdef HAVE_NLS
 +#ifdef ENABLE_NLS
  # include <locale.h>
  #endif
  #include <assert.h>
  #include <errno.h>
  #include <time.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "init.h"
  #include "retr.h"
@@@ -54,7 -56,8 +55,7 @@@
  #include "spider.h"
  #include "http.h"               /* for save_cookies */
  
 -/* On GNU system this will include system-wide getopt.h. */
 -#include "getopt.h"
 +#include <getopt.h>
  
  #ifndef PATH_SEPARATOR
  # define PATH_SEPARATOR '/'
@@@ -78,14 -81,14 +79,14 @@@ const char *exec_name
  static void
  i18n_initialize (void)
  {
 -  /* HAVE_NLS implies existence of functions invoked here.  */
 -#ifdef HAVE_NLS
 +  /* ENABLE_NLS implies existence of functions invoked here.  */
 +#ifdef ENABLE_NLS
    /* Set the current locale.  */
    setlocale (LC_ALL, "");
    /* Set the text message domain.  */
    bindtextdomain ("wget", LOCALEDIR);
    textdomain ("wget");
 -#endif /* HAVE_NLS */
 +#endif /* ENABLE_NLS */
  }
  \f
  /* Definition of command-line options. */
@@@ -688,7 -691,7 +689,7 @@@ There is NO WARRANTY, to the extent per
  \f
  
  int
 -main (int argc, char *const *argv)
 +main (int argc, char **argv)
  {
    char **url, **t;
    int i, ret, longindex;
  
  #ifdef WINDOWS
    /* Drop extension (typically .EXE) from executable filename. */
 -  windows_main (&argc, (char **) argv, (char **) &exec_name);
 +  windows_main ((char **) &exec_name);
  #endif
  
    /* Set option defaults; read the system wgetrc and ~/.wgetrc.  */
                 before passing the value to setoptval.  */
              bool flag = true;
              if (optarg)
 -              flag = (*optarg == '1' || TOLOWER (*optarg) == 'y'
 -                      || (TOLOWER (optarg[0]) == 'o'
 -                          && TOLOWER (optarg[1]) == 'n'));
 +              flag = (*optarg == '1' || c_tolower (*optarg) == 'y'
 +                      || (c_tolower (optarg[0]) == 'o'
 +                          && c_tolower (optarg[1]) == 'n'));
              setoptval (opt->type == OPT__PARENT ? "noparent" : "noclobber",
                         flag ? "0" : "1", opt->long_name);
              break;
       interoption dependency checks. */
  
    if (opt.reclevel == 0)
 -    opt.reclevel = INFINITE_RECURSION; /* see recur.h for commentary on this */
 +      opt.reclevel = INFINITE_RECURSION; /* see recur.h for commentary */
 +
 +  if (opt.spider || opt.delete_after)
 +      opt.no_dirstruct = true;
  
    if (opt.page_requisites && !opt.recursive)
      {
diff --combined src/mswindows.c
index a778e1267c8917aaf296a882f61c33e180f4fb6e,f96db154324de5370e39098028006b0ed95e5631..1dd979269d8b93fe64df076a136740f77f52b31f
@@@ -17,19 -17,18 +17,20 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#define INHIBIT_WRAP /* avoid wrapping of socket, bind, ... */
 +
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -38,7 -37,9 +39,7 @@@
  #include <errno.h>
  #include <math.h>
  
 -#define INHIBIT_WRAP /* avoid wrapping of socket, bind, ... */
  
 -#include "wget.h"
  #include "utils.h"
  #include "url.h"
  
@@@ -73,7 -74,7 +74,7 @@@ xsleep (double seconds
  }
  
  void
 -windows_main (int *argc, char **argv, char **exec_name)
 +windows_main (char **exec_name)
  {
    char *p;
  
@@@ -87,7 -88,6 +88,7 @@@
  static void
  ws_cleanup (void)
  {
 +  xfree ((char*)exec_name);
    WSACleanup ();
  }
  
diff --combined src/mswindows.h
index d339bb32e036f456c0dc7b8b82298b06fd834d21,8fe9a3446ecdfefeaafccd2dfca412972dc03607..36b64d11295005b33043208d978fac1e35648923
@@@ -17,15 -17,16 +17,16 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
  #ifndef MSWINDOWS_H
  #define MSWINDOWS_H
@@@ -208,6 -209,6 +209,6 @@@ void ws_startup (void)
  void ws_changetitle (const char *);
  void ws_percenttitle (double);
  char *ws_mypath (void);
 -void windows_main (int *, char **, char **);
 +void windows_main (char **);
  
  #endif /* MSWINDOWS_H */
diff --combined src/netrc.c
index c50b25810ccd8cd0af2629e0c4053f3ceec7fe9d,c70a8a348ae35d87b6015a462273f2c70e763bb5..84f722eded223991afe9a8116ed214a2e099f675
@@@ -16,26 -16,30 +16,27 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
  /* This file used to be kept in synch with the code in Fetchmail, but
     the latter has diverged since.  */
  
 -#ifdef HAVE_CONFIG_H
 -# include <config.h>
 -#endif
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <errno.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "netrc.h"
  #include "init.h"
@@@ -280,7 -284,7 +281,7 @@@ parse_netrc (const char *path
        quote = 0;
  
        /* Skip leading whitespace.  */
 -      while (*p && ISSPACE (*p))
 +      while (*p && c_isspace (*p))
          p ++;
  
        /* If the line is empty, then end any macro definition.  */
        while (*p && last_token != tok_macdef)
          {
            /* Skip any whitespace.  */
 -          while (*p && ISSPACE (*p))
 +          while (*p && c_isspace (*p))
              p ++;
  
            /* Discard end-of-line comments; also, stop processing if
            tok = p;
  
            /* Find the end of the token, handling quotes and escapes.  */
 -          while (*p && (quote ? *p != '"' : !ISSPACE (*p))){
 +          while (*p && (quote ? *p != '"' : !c_isspace (*p))){
              if (*p == '\\')
                shift_left (p);
              p ++;
diff --combined src/openssl.c
index 296463f9ea4ddba2d7a1728743fd842b4881a222,ff886609a053ecce3cf2c14a6427873492d09070..143271e0c2b74060b7be68ccb263cd39c28ce329
@@@ -18,17 -18,18 +18,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <assert.h>
  #include <errno.h>
@@@ -42,6 -43,7 +43,6 @@@
  #include <openssl/err.h>
  #include <openssl/rand.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "connect.h"
  #include "url.h"
@@@ -438,13 -440,13 +439,13 @@@ pattern_match (const char *pattern, con
  {
    const char *p = pattern, *n = string;
    char c;
 -  for (; (c = TOLOWER (*p++)) != '\0'; n++)
 +  for (; (c = c_tolower (*p++)) != '\0'; n++)
      if (c == '*')
        {
 -        for (c = TOLOWER (*p); c == '*'; c = TOLOWER (*++p))
 +        for (c = c_tolower (*p); c == '*'; c = c_tolower (*++p))
            ;
          for (; *n != '\0'; n++)
 -          if (TOLOWER (*n) == c && pattern_match (p, n))
 +          if (c_tolower (*n) == c && pattern_match (p, n))
              return true;
  #ifdef ASTERISK_EXCLUDES_DOT
            else if (*n == '.')
        }
      else
        {
 -        if (c != TOLOWER (*n))
 +        if (c != c_tolower (*n))
            return false;
        }
    return *n == '\0';
diff --combined src/progress.c
index debd03e8e690bef2c033c3b36934ad7f8cb9896b,14ca2737f554df364e162045a8e6e53dc20c1ea0..02d7f38d7fc5cff3747d1376a1e1d7c2ad5927d6
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -38,6 -39,7 +39,6 @@@
  #endif
  #include <signal.h>
  
 -#include "wget.h"
  #include "progress.h"
  #include "utils.h"
  #include "retr.h"
diff --combined src/ptimer.c
index bce8a3e5ffe5f1448510762e3829c8e2d2b3b56a,023db209c28869a8b49da182ad97093535484acd..4a6c89fb1c56f31ed5523f8e9ce3086c0fb4c684
@@@ -16,15 -16,16 +16,16 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
  /* This file implements "portable timers" (ptimers), objects that
     measure elapsed time using the primitives most appropriate for the
@@@ -49,7 -50,7 +50,7 @@@
       double secs = ptimer_measure ();
       printf ("The loop took %.2fs\n", secs);  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -70,6 -71,7 +71,6 @@@
  # include <windows.h>
  #endif
  
 -#include "wget.h"
  #include "ptimer.h"
  
  /* Depending on the OS, one and only one of PTIMER_POSIX,
diff --combined src/recur.c
index 8d7b0940488a8f535a3f7a7e96435c26ed9ad814,e32dc64537fcf5db233d5a9e500ccd4c83fe6aa2..9fbcafed9cff2ea25578bcc2d2e44f9b1f94cfb9
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -38,6 -39,7 +39,6 @@@
  #include <errno.h>
  #include <assert.h>
  
 -#include "wget.h"
  #include "url.h"
  #include "recur.h"
  #include "utils.h"
@@@ -569,17 -571,6 +570,17 @@@ download_child_p (const struct urlpos *
            if (res_retrieve_file (url, &rfile))
              {
                specs = res_parse_from_file (rfile);
 +
 +              /* Delete the robots.txt file if we chose to either delete the
 +                 files after downloading or we're just running a spider. */
 +              if (opt.delete_after || opt.spider)
 +                {
 +                  logprintf (LOG_VERBOSE, "Removing %s.\n", rfile);
 +                  if (unlink (rfile))
 +                      logprintf (LOG_NOTQUIET, "unlink: %s\n",
 +                                 strerror (errno));
 +                }
 +
                xfree (rfile);
              }
            else
diff --combined src/res.c
index 1f46f6d1df7332b93e2ab9b71859f5c0283ec375,626b2c85cdb7185f12e9ddd334d073be71ab025c..34676128798dfa0b22eba42b75330b284d88aa46
+++ b/src/res.c
@@@ -16,15 -16,16 +16,16 @@@ General Public License for more details
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
  /* This file implements the Robot Exclusion Standard (RES).
  
@@@ -66,7 -67,9 +67,7 @@@
     res_match_path, res_register_specs, res_get_specs, and
     res_retrieve_file.  */
  
 -#ifdef HAVE_CONFIG_H
 -# include <config.h>
 -#endif
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -74,6 -77,7 +75,6 @@@
  #include <errno.h>
  #include <assert.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "hash.h"
  #include "url.h"
@@@ -177,7 -181,7 +178,7 @@@ prune_non_exact (struct robot_specs *sp
  #define EOL(p) ((p) >= lineend)
  
  #define SKIP_SPACE(p) do {              \
 -  while (!EOL (p) && ISSPACE (*p))      \
 +  while (!EOL (p) && c_isspace (*p))      \
      ++p;                                \
  } while (0)
  
@@@ -263,18 -267,18 +264,18 @@@ res_parse (const char *source, int leng
           lineend to a location preceding the first comment.  Real line
           ending remains in lineend_real.  */
        for (lineend = p; lineend < lineend_real; lineend++)
 -        if ((lineend == p || ISSPACE (*(lineend - 1)))
 +        if ((lineend == p || c_isspace (*(lineend - 1)))
              && *lineend == '#')
            break;
  
        /* Ignore trailing whitespace in the same way. */
 -      while (lineend > p && ISSPACE (*(lineend - 1)))
 +      while (lineend > p && c_isspace (*(lineend - 1)))
          --lineend;
  
        assert (!EOL (p));
  
        field_b = p;
 -      while (!EOL (p) && (ISALNUM (*p) || *p == '-'))
 +      while (!EOL (p) && (c_isalnum (*p) || *p == '-'))
          ++p;
        field_e = p;
  
@@@ -412,7 -416,7 +413,7 @@@ free_specs (struct robot_specs *specs
     advance the pointer.  */
  
  #define DECODE_MAYBE(c, ptr) do {                               \
 -  if (c == '%' && ISXDIGIT (ptr[1]) && ISXDIGIT (ptr[2]))       \
 +  if (c == '%' && c_isxdigit (ptr[1]) && c_isxdigit (ptr[2]))       \
      {                                                           \
        char decoded = X2DIGITS_TO_NUM (ptr[1], ptr[2]);          \
        if (decoded != '/')                                       \
diff --combined src/retr.c
index 53bc5ee3e7543e67dc56571fb21925bc5f4d691c,e8caf34c3df96cdf55edb7559ef7d1cc37afe542..364377226025d58943fdcc85040b1b76d4069929
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -38,6 -39,7 +39,6 @@@
  #include <string.h>
  #include <assert.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "retr.h"
  #include "progress.h"
diff --combined src/spider.c
index 391efc288f0e590ef9c564f0ec264633faa28b73,b12552d37ae4194d1f8803c6bcf11aa959650c50..492bd81156fd8563648b9c0973985702a9d1ef90
@@@ -16,22 -16,24 +16,23 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <errno.h>
  #include <assert.h>
  
 -#include "wget.h"
  #include "spider.h"
  #include "url.h"
  #include "utils.h"
diff --combined src/sysdep.h
index fe48925b9eec4c8c220c0a187d7d8e897bb10ba6,c4a7a88ffdcd0c1e444fd556c78db466f8d6568f..b91cc1e6ef06a78852f023692b36153aa9400409
@@@ -17,15 -17,16 +17,16 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
  /* This file is included by wget.h.  Random .c files need not include
     it.  */
  #ifndef SYSDEP_H
  #define SYSDEP_H
  
 +/* Testing for __sun is not enough because it's also defined on SunOS.  */
 +#ifdef __sun
 +# ifdef __SVR4
 +#  define solaris
 +# endif
 +#endif
 +
 +/* The "namespace tweaks" below attempt to set a friendly "compilation
 +   environment" under popular operating systems.  Default compilation
 +   environment often means that some functions that are "extensions"
 +   are not declared -- `strptime' is one example.
 +
 +   But non-default environments can expose bugs in the system header
 +   files, crippling compilation in _very_ non-obvious ways.  Because
 +   of that, we define them only on well-tested architectures where we
 +   know they will work.  */
 +
 +#undef NAMESPACE_TWEAKS
 +
 +#ifdef solaris
 +# define NAMESPACE_TWEAKS
 +#endif
 +
 +#ifdef __linux__
 +# define NAMESPACE_TWEAKS
 +#endif
 +
 +#ifdef NAMESPACE_TWEAKS
 +
 +/* Request the "Unix 98 compilation environment". */
 +#define _XOPEN_SOURCE 500
 +
 +/* For Solaris: request everything else that is available and doesn't
 +   conflict with the above.  */
 +#define __EXTENSIONS__
 +
 +/* For Linux: request features of 4.3BSD and SVID (System V Interface
 +   Definition). */
 +#define _SVID_SOURCE
 +#define _BSD_SOURCE
 +
 +/* Under glibc-based systems we want all GNU extensions as well.  This
 +   declares some unnecessary cruft, but also useful functions such as
 +   timegm, FNM_CASEFOLD extension to fnmatch, memrchr, etc.  */
 +#define _GNU_SOURCE
 +
 +#endif /* NAMESPACE_TWEAKS */
 +
 +
 +/* Alloca declaration, based on recommendation in the Autoconf manual.
 +   These have to be after the above namespace tweaks, but before any
 +   non-preprocessor code.  */
 +
 +#if HAVE_ALLOCA_H
 +# include <alloca.h>
 +#elif defined WINDOWS
 +# include <malloc.h>
 +# ifndef alloca
 +#  define alloca _alloca
 +# endif
 +#elif defined __GNUC__
 +# define alloca __builtin_alloca
 +#elif defined _AIX
 +# define alloca __alloca
 +#else
 +# include <stddef.h>
 +# ifdef  __cplusplus
 +extern "C"
 +# endif
 +void *alloca (size_t);
 +#endif
 +
  /* Must include these, so we can test for the missing stat macros and
     define them as necessary.  */
  #include <sys/types.h>
  #include <sys/stat.h>
  
  #ifdef HAVE_INTTYPES_H
 +  /* Compaq C V6.5-303 (dtk) on HP Tru64 UNIX V5.1B (Rev. 2650) needs: */
 +# include <stdint.h>
  # include <inttypes.h>
  #endif
  
diff --combined src/url.c
index 2f6dc784939eaf27dd469d7f0169301b1ec4384c,46060df5fc54db42c18912273a11d19e2c031ba9..a3f70ed1b3e8f3c99c9ae7ebbf236155880c66d0
+++ b/src/url.c
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -38,6 -39,7 +39,6 @@@
  #include <errno.h>
  #include <assert.h>
  
 -#include "wget.h"
  #include "utils.h"
  #include "url.h"
  #include "host.h"  /* for is_valid_ipv6_address */
@@@ -182,7 -184,7 +183,7 @@@ url_unescape (char *s
          {
            char c;
            /* Do nothing if '%' is not followed by two hex digits. */
 -          if (!h[1] || !h[2] || !(ISXDIGIT (h[1]) && ISXDIGIT (h[2])))
 +          if (!h[1] || !h[2] || !(c_isxdigit (h[1]) && c_isxdigit (h[2])))
              goto copychar;
            c = X2DIGITS_TO_NUM (h[1], h[2]);
            /* Don't unescape %00 because there is no way to insert it
@@@ -271,7 -273,7 +272,7 @@@ char_needs_escaping (const char *p
  {
    if (*p == '%')
      {
 -      if (ISXDIGIT (*(p + 1)) && ISXDIGIT (*(p + 2)))
 +      if (c_isxdigit (*(p + 1)) && c_isxdigit (*(p + 2)))
          return false;
        else
          /* Garbled %.. sequence: encode `%'. */
@@@ -427,7 -429,7 +428,7 @@@ url_scheme (const char *url
    return SCHEME_INVALID;
  }
  
 -#define SCHEME_CHAR(ch) (ISALNUM (ch) || (ch) == '-' || (ch) == '+')
 +#define SCHEME_CHAR(ch) (c_isalnum (ch) || (ch) == '-' || (ch) == '+')
  
  /* Return 1 if the URL begins with any "scheme", 0 otherwise.  As
     currently implemented, it returns true if URL begins with
@@@ -589,10 -591,10 +590,10 @@@ lowercase_str (char *str
  {
    bool changed = false;
    for (; *str; str++)
 -    if (ISUPPER (*str))
 +    if (c_isupper (*str))
        {
          changed = true;
 -        *str = TOLOWER (*str);
 +        *str = c_tolower (*str);
        }
    return changed;
  }
@@@ -768,7 -770,7 +769,7 @@@ url_parse (const char *url, int *error
        if (port_b != port_e)
          for (port = 0, pp = port_b; pp < port_e; pp++)
            {
 -            if (!ISDIGIT (*pp))
 +            if (!c_isdigit (*pp))
                {
                  /* http://host:12randomgarbage/blah */
                  /*               ^                  */
@@@ -1220,7 -1222,7 +1221,7 @@@ append_char (char ch, struct growable *
  
  enum {
    filechr_not_unix    = 1,      /* unusable on Unix, / and \0 */
 -  filechr_not_windows = 2,      /* unusable on MSDOS/Windows, one of \|/<>?:*" */
 +  filechr_not_windows = 2,      /* unusable on Windows, one of \|/<>?:*" */
    filechr_control     = 4       /* a control character, e.g. 0-31 */
  };
  
@@@ -1372,9 -1374,9 +1373,9 @@@ append_uri_pathel (const char *b, cons
        for (q = TAIL (dest); q < TAIL (dest) + outlen; ++q)
          {
            if (opt.restrict_files_case == restrict_lowercase)
 -            *q = TOLOWER (*q);
 +            *q = c_tolower (*q);
            else
 -            *q = TOUPPER (*q);
 +            *q = c_toupper (*q);
          }
      }
            
@@@ -1939,7 -1941,7 +1940,7 @@@ getchar_from_escaped_string (const cha
    
    if (p[0] == '%')
      {
 -      if (!ISXDIGIT(p[1]) || !ISXDIGIT(p[2]))
 +      if (!c_isxdigit(p[1]) || !c_isxdigit(p[2]))
          {
            *c = '%';
            return 1;
@@@ -1981,7 -1983,7 +1982,7 @@@ are_urls_equal (const char *u1, const c
    while (*p && *q
           && (pp = getchar_from_escaped_string (p, &ch1))
           && (qq = getchar_from_escaped_string (q, &ch2))
 -         && (TOLOWER(ch1) == TOLOWER(ch2)))
 +         && (c_tolower(ch1) == c_tolower(ch2)))
      {
        p += pp;
        q += qq;
diff --combined src/utils.c
index 5e31e0e16873e152e8c1fca2bf0454aae164cb81,641793e9e8c90c57ca808cbc7abae54beed968ce..b720f7d79fabe462a90b090dab53651c5b3fade2
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -42,9 -43,6 +43,9 @@@
  #ifdef HAVE_MMAP
  # include <sys/mman.h>
  #endif
 +#ifdef HAVE_PROCESS_H
 +# include <process.h>  /* getpid() */
 +#endif
  #ifdef HAVE_UTIME_H
  # include <utime.h>
  #endif
@@@ -80,6 -78,7 +81,6 @@@
  # define USE_SIGNAL_TIMEOUT
  #endif
  
 -#include "wget.h"
  #include "utils.h"
  #include "hash.h"
  
@@@ -95,7 -94,7 +96,7 @@@ xstrdup_lower (const char *s
    char *copy = xstrdup (s);
    char *p = copy;
    for (; *p; p++)
 -    *p = TOLOWER (*p);
 +    *p = c_tolower (*p);
    return copy;
  }
  
@@@ -134,7 -133,7 +135,7 @@@ sepstring (const char *s
            res[++i] = NULL;
            ++s;
            /* Skip the blanks following the ','.  */
 -          while (ISSPACE (*s))
 +          while (c_isspace (*s))
              ++s;
            p = s;
          }
@@@ -635,10 -634,10 +636,10 @@@ fnmatch_nocase (const char *pattern, co
    char *strcopy = (char *) alloca (strlen (string) + 1);
    char *p;
    for (p = patcopy; *pattern; pattern++, p++)
 -    *p = TOLOWER (*pattern);
 +    *p = c_tolower (*pattern);
    *p = '\0';
    for (p = strcopy; *string; string++, p++)
 -    *p = TOLOWER (*string);
 +    *p = c_tolower (*string);
    *p = '\0';
    return fnmatch (patcopy, strcopy, flags);
  #endif
@@@ -680,7 -679,7 +681,7 @@@ subdir_p (const char *d1, const char *d
      for (; *d1 && *d2 && (*d1 == *d2); ++d1, ++d2)
        ;
    else
 -    for (; *d1 && *d2 && (TOLOWER (*d1) == TOLOWER (*d2)); ++d1, ++d2)
 +    for (; *d1 && *d2 && (c_tolower (*d1) == c_tolower (*d2)); ++d1, ++d2)
        ;
    
    return *d1 == '\0' && (*d2 == '\0' || *d2 == '/');
@@@ -765,7 -764,7 +766,7 @@@ match_tail (const char *string, const c
    else
      {
        for (i = strlen (string), j = strlen (tail); i >= 0 && j >= 0; i--, j--)
 -        if (TOLOWER (string[i]) != TOLOWER (tail[j]))
 +        if (c_tolower (string[i]) != c_tolower (tail[j]))
            break;
      }
  
@@@ -1939,7 -1938,7 +1940,7 @@@ base64_encode (const void *data, int le
     when end of string is reached.  */
  #define NEXT_CHAR(c, p) do {                    \
    c = (unsigned char) *p++;                     \
 -} while (ISSPACE (c))
 +} while (c_isspace (c))
  
  #define IS_ASCII(c) (((c) & 0x80) == 0)
  
diff --combined src/wget.h
index 8dcb9f047a454ffa020fbbdf4d29aac3f754feb3,22603a68ba9e169fb6869fafd3c84283907b453e..12511e581af919b569147a8d7944f01ee02eb5f9
@@@ -17,15 -17,16 +17,16 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
  /* This file contains declarations that are universally useful and
     those that don't fit elsewhere.  It also includes sysdep.h which
  #ifndef WGET_H
  #define WGET_H
  
 +#include "config.h"
 +
 +/* Include these, so random files need not include them.  */
 +#include "sysdep.h"
 +
  /* Disable assertions when debug support is not compiled in. */
  #ifndef ENABLE_DEBUG
  # define NDEBUG
  
  /* `gettext (FOO)' is long to write, so we use `_(FOO)'.  If NLS is
     unavailable, _(STRING) simply returns STRING.  */
 -#ifdef HAVE_NLS
 -# define _(string) gettext (string)
 -# ifdef HAVE_LIBINTL_H
 -#  include <libintl.h>
 -# else  /* not HAVE_LIBINTL_H */
 -   const char *gettext ();
 -# endif /* not HAVE_LIBINTL_H */
 -#else  /* not HAVE_NLS */
 -# define _(string) (string)
 -# define ngettext(sing, plur, num)  ((num) == 1 ? (sing) : (plur))
 -#endif /* not HAVE_NLS */
 +#include "gettext.h"
 +#define _(string)   gettext (string)
  
  /* A pseudo function call that serves as a marker for the automated
     extraction of messages, but does not call gettext().  The run-time
     debug problems with Wget.  If I get them in a language I don't
     understand, debugging will become a new challenge of its own!  */
  
 -
 -/* Include these, so random files need not include them.  */
 -#include "sysdep.h"
  /* locale independent replacement for ctype.h */
 -#include "safe-ctype.h"
 +#include "c-ctype.h"
  
  /* Conditionalize the use of GCC's __attribute__((format)) and
     __builtin_expect features using macros.  */
@@@ -215,7 -223,7 +216,7 @@@ typedef double SUM_SIZE_INT
  /* Convert an ASCII hex digit to the corresponding number between 0
     and 15.  H should be a hexadecimal digit that satisfies isxdigit;
     otherwise, the result is undefined.  */
 -#define XDIGIT_TO_NUM(h) ((h) < 'A' ? (h) - '0' : TOUPPER (h) - 'A' + 10)
 +#define XDIGIT_TO_NUM(h) ((h) < 'A' ? (h) - '0' : c_toupper (h) - 'A' + 10)
  #define X2DIGITS_TO_NUM(h1, h2) ((XDIGIT_TO_NUM (h1) << 4) + XDIGIT_TO_NUM (h2))
  
  /* The reverse of the above: convert a number in the [0, 16) range to
diff --combined src/xmalloc.c
index ac80fb38c996e3e20990d4ca1e75a2f42907d27f,35f2c1993a0862200988e099ed13af88c6ad2418..8c70795621977f236b02397fe3e2cf76f65943a2
@@@ -17,17 -17,18 +17,18 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
 -#include <config.h>
 +#include "wget.h"
  
  #include <stdio.h>
  #include <stdlib.h>
@@@ -35,6 -36,7 +36,6 @@@
  #include <errno.h>
  #include <assert.h>
  
 -#include "wget.h"
  #include "xmalloc.h"
  #include "hash.h"               /* for hash_pointer */
  
diff --combined tests/ChangeLog
index d2084e683790523d724bdb1f664efc5a254b66ff,a1488e46a7491d7366eede6f1f5a21e5f9fdee95..3937962554ceb941e370c55be6b563d1dbafab5f
@@@ -1,14 -1,8 +1,19 @@@
 -      * Makefile.in: Updated license exception for OpenSSL, per the
+ 2007-11-28  Micah Cowan <micah@cowan.name>
++      * Makefile.am: Updated license exception for OpenSSL, per the
+       SFLC.
 +2007-10-18  Micah Cowan  <micah@cowan.name>
 +
 +      * Makefile.am: Add dependency for unit_tests on libgnu.a.
 +
 +2007-10-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 +
 +      * WgetTest.pm.in: wget is built in the build tree.  Use an
 +      absolute path to the binary.
 +      * Makefile.in: Removed, replaced by Makefile.am.
 +      * Makefile.am: Converted from Makefile.in.
 +
  2007-09-25  Micah Cowan  <micah@cowan.name>
  
        * Makefile.in: Use EXEEXT instead of exeext.
diff --combined tests/Makefile.am
index 51d3f870f42f073765cc75025c3264d94d0f7bc4,0000000000000000000000000000000000000000..ad61e46aeeb58dc61bd74af8b75f259fc69e1de0
mode 100644,000000..100644
--- /dev/null
@@@ -1,103 -1,0 +1,104 @@@
- # In addition, as a special exception, the Free Software Foundation
- # gives permission to link the code of its release of Wget with the
- # OpenSSL project's "OpenSSL" library (or with modified versions of it
- # that use the same license as the "OpenSSL" library), and distribute
- # the linked executables.  You must obey the GNU General Public License
- # in all respects for all of the code used other than "OpenSSL".  If you
- # modify this file, you may extend this exception to your version of the
- # file, but you are not obligated to do so.  If you do not wish to do
- # so, delete this exception statement from your version.
 +# Makefile for `wget' utility
 +# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
 +# 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
 +# the Free Software Foundation; either version 3 of the License, or
 +# (at your option) any later version.
 +
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
 +
 +# You should have received a copy of the GNU General Public License
 +# along with Wget.  If not, see <http://www.gnu.org/licenses/>.
 +
++# Additional permission under GNU GPL version 3 section 7
++
++# If you modify this program, or any covered work, by linking or
++# combining it with the OpenSSL project's OpenSSL library (or a
++# modified version of that library), containing parts covered by the
++# terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
++# grants you additional permission to convey the resulting work.
++# Corresponding Source for a non-source form of such a combination
++# shall include the source code for the parts of OpenSSL used as well
++# as that of the covered work.
 +
 +#
 +# Version: @VERSION@
 +#
 +
 +PERL     = perl
 +PERLRUN = $(PERL) -I$(srcdir)
 +
 +.PHONY: test run-unit-tests run-px-tests
 +
 +check-local: test
 +
 +test: ../src/wget$(EXEEXT) run-unit-tests #run-px-tests
 +
 +../src/wget$(EXEEXT):
 +      cd ../src && $(MAKE) $(AM_MAKEFLAGS)
 +
 +run-unit-tests: unit-tests$(EXEEXT)
 +      ./unit-tests$(EXEEXT)
 +
 +run-px-tests: WgetTest.pm
 +      $(PERLRUN) $(srcdir)/Test-auth-basic.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-c-full.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-c-partial.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-c.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-E-k-K.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-E-k.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-ftp.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-HTTP-Content-Disposition-1.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-HTTP-Content-Disposition-2.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-HTTP-Content-Disposition.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-N-current-HTTP-CD.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-N-current.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-N-HTTP-Content-Disposition.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-N--no-content-disposition.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-N--no-content-disposition-trivial.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test--no-content-disposition.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test--no-content-disposition-trivial.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-N-old.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-nonexisting-quiet.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-noop.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-np.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-N.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-O-HTTP-Content-Disposition.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-O--no-content-disposition.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-O--no-content-disposition-trivial.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-O-nonexisting.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-O.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-Restrict-Lowercase.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test-Restrict-Uppercase.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test--spider-fail.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test--spider-HTTP-Content-Disposition.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test--spider--no-content-disposition.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test--spider--no-content-disposition-trivial.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test--spider.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test--spider-r-HTTP-Content-Disposition.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test--spider-r--no-content-disposition.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test--spider-r--no-content-disposition-trivial.px && echo && echo
 +      $(PERLRUN) $(srcdir)/Test--spider-r.px && echo && echo
 +
 +EXTRA_DIST = FTPServer.pm FTPTest.pm HTTPServer.pm HTTPTest.pm \
 +           Test-auth-basic.px Test-c-full.px Test-c-partial.px \
 +           Test-c.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-old.px Test-nonexisting-quiet.px \
 +           Test-noop.px Test-np.px Test-N.px \
 +           Test-O-nonexisting.px Test-O.px \
 +           Test-Restrict-Lowercase.px Test-Restrict-Uppercase.px \
 +           Test--spider-fail.px Test--spider.px Test--spider-r.px
 +
 +check_PROGRAMS = unit-tests
 +unit_tests_SOURCES = 
 +LDADD = ../src/libunittest.a ../lib/libgnu.a @LIBSSL@ @LIBGNUTLS@
 +
 +CLEANFILES = *~ *.bak core core.[0-9]*
diff --combined util/Makefile.am
index 83c79d27954774ca78895085dbe451a0803c0637,0000000000000000000000000000000000000000..76fdad1e7d22151003a12da27c4c526b11dcb968
mode 100644,000000..100644
--- /dev/null
@@@ -1,32 -1,0 +1,33 @@@
- # In addition, as a special exception, the Free Software Foundation
- # gives permission to link the code of its release of Wget with the
- # OpenSSL project's "OpenSSL" library (or with modified versions of it
- # that use the same license as the "OpenSSL" library), and distribute
- # the linked executables.  You must obey the GNU General Public License
- # in all respects for all of the code used other than "OpenSSL".  If you
- # modify this file, you may extend this exception to your version of the
- # file, but you are not obligated to do so.  If you do not wish to do
- # so, delete this exception statement from your version.
 +# Makefile for `wget' utility
 +# Copyright (C) 1995, 1996, 1997, 2007 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
 +# the Free Software Foundation; either version 3 of the License, or
 +# (at your option) any later version.
 +
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
 +
 +# You should have received a copy of the GNU General Public License
 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +
++# Additional permission under GNU GPL version 3 section 7
++
++# If you modify this program, or any covered work, by linking or
++# combining it with the OpenSSL project's OpenSSL library (or a
++# modified version of that library), containing parts covered by the
++# terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
++# grants you additional permission to convey the resulting work.
++# Corresponding Source for a non-source form of such a combination
++# shall include the source code for the parts of OpenSSL used as well
++# as that of the covered work.
 +
 +#
 +# Version: @VERSION@
 +#
 +
 +EXTRA_DIST = dist-wget download.html download-netscape.html \
 +           rmold.pl update_po_files.sh wget.spec
diff --combined windows/ChangeLog
index f6a089c46a5fef0e9f7617c70c65ad3abcf897f6,36e89c3c7df9fb1dd8652b72857972d73f7168d9..500013c06c40bb8aa0bc6d69564b679ceb4e9dba
@@@ -1,12 -1,9 +1,18 @@@
 -      * Makefile.doc, Makefile.in, Makefile.src, Makefile.top,
+ 2007-11-28  Micah Cowan <micah@cowan.name>
++      * Makefile.doc, Makefile.am, Makefile.src, Makefile.top,
+       Makefile.top.bor, Makefile.top.mingw, config-compiler.h: Updated
+       license exception for OpenSSL, per the SFLC.
 +2007-10-15  Gisle Vanem  <giva@bgnett.no>
 +
 +      * config-compiler.h: Adjust for OpenWacom 1.7's _Bool fix.
 +
 +2007-10-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 +
 +      * Makefile.in: Removed, replaced by Makefile.am.
 +      * Makefile.am: Converted from Makefile.in.
 +
  2007-09-24  Christopher Lewis <chris@christopherlewis.com>
  
        * config-compiler.h: Fix compiler warnings related to
diff --combined windows/Makefile.am
index 914bbb74701cd901fff4e0874c78bb276fabd292,0000000000000000000000000000000000000000..10771ca67f6d30b60e5061da55b8ff52a284fd0e
mode 100644,000000..100644
--- /dev/null
@@@ -1,37 -1,0 +1,38 @@@
- # In addition, as a special exception, the Free Software Foundation
- # gives permission to link the code of its release of Wget with the
- # OpenSSL project's "OpenSSL" library (or with modified versions of it
- # that use the same license as the "OpenSSL" library), and distribute
- # the linked executables.  You must obey the GNU General Public License
- # in all respects for all of the code used other than "OpenSSL".  If you
- # modify this file, you may extend this exception to your version of the
- # file, but you are not obligated to do so.  If you do not wish to do
- # so, delete this exception statement from your version.
 +# Makefile for `wget' utility
 +# Copyright (C) 1995, 1996, 1997, 2007 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
 +# the Free Software Foundation; either version 3 of the License, or
 +# (at your option) any later version.
 +
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
 +
 +# You should have received a copy of the GNU General Public License
 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +
++# Additional permission under GNU GPL version 3 section 7
++
++# If you modify this program, or any covered work, by linking or
++# combining it with the OpenSSL project's OpenSSL library (or a
++# modified version of that library), containing parts covered by the
++# terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
++# grants you additional permission to convey the resulting work.
++# Corresponding Source for a non-source form of such a combination
++# shall include the source code for the parts of OpenSSL used as well
++# as that of the covered work.
 +
 +#
 +# Version: @VERSION@
 +#
 +
 +# This file is just a stub, so that the build subprocess in `windows'
 +# succeeds.  This directory is not used under Unix builds, normally
 +# affected by Makefile.in.
 +
 +EXTRA_DIST = config-compiler.h config.h Makefile.doc \
 +           Makefile.src Makefile.src.bor Makefile.src.mingw \
 +           Makefile.top Makefile.top.bor Makefile.top.mingw
index 6a73c189809db37f880af4f9bb4df2ee5fc070eb,496442d01fa7b22eca216ac5d7f15ba440ca65b7..b74292c85bd7cf27ddf09d36ded71d7f7e07a547
@@@ -16,15 -16,16 +16,16 @@@ GNU General Public License for more det
  You should have received a copy of the GNU General Public License
  along with Wget.  If not, see <http://www.gnu.org/licenses/>.
  
- In addition, as a special exception, the Free Software Foundation
- gives permission to link the code of its release of Wget with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables.  You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL".  If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so.  If you do not wish to do
- so, delete this exception statement from your version.  */
+ Additional permission under GNU GPL version 3 section 7
+ If you modify this program, or any covered work, by linking or
+ combining it with the OpenSSL project's OpenSSL library (or a
+ modified version of that library), containing parts covered by the
+ terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+ grants you additional permission to convey the resulting work.
+ Corresponding Source for a non-source form of such a combination
+ shall include the source code for the parts of OpenSSL used as well
+ as that of the covered work.  */
  
  
  /* This file contains information about various compilers used to
  #define HAVE_STDINT_H 1
  #define HAVE_INTTYPES_H 1
  
 -/* Watcom 1.6 do have <stdbool.h>, but definition of '_Bool' is missing! */
 -/* #define HAVE_STDBOOL_H 1 */
 +/* OpenWatcom 1.6 do have <stdbool.h>, but definition of '_Bool' is missing! */
 +/* This was fixed in OpenWatcom 1.7 */
 +#if __WATCOMC__ >= 1270
 +#define HAVE_STDBOOL_H 1
 +#define HAVE__BOOL 1
 +#endif
 +
  #define HAVE_STRTOLL 1
  #define HAVE_UINT32_T 1
  #undef HAVE_UTIME_H