/* Reading/parsing the initialization file.
- Copyright (C) 1996-2006 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+ 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Wget.
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>
add any entries that allocate memory (e.g. cmd_string and
cmd_vector) to the cleanup() function below. */
-static struct {
+static const struct {
const char *name;
void *place;
bool (*action) (const char *, const char *, void *);
{ "useragent", NULL, cmd_spec_useragent },
{ "verbose", NULL, cmd_spec_verbose },
{ "wait", &opt.wait, cmd_time },
- { "waitretry", &opt.waitretry, cmd_time }
+ { "waitretry", &opt.waitretry, cmd_time },
+#ifdef MSDOS
+ { "wdebug", &opt.wdebug, cmd_boolean },
+#endif
};
/* Look up CMDNAME in the commands[] and return its position in the
#endif
/* The default for file name restriction defaults to the OS type. */
-#if !defined(WINDOWS) && !defined(__CYGWIN__)
- opt.restrict_files_os = restrict_unix;
-#else
+#if defined(WINDOWS) || defined(MSDOS) || defined(__CYGWIN__)
opt.restrict_files_os = restrict_windows;
+#else
+ opt.restrict_files_os = restrict_unix;
#endif
opt.restrict_files_ctrl = true;
opt.restrict_files_case = restrict_no_case_restriction;
- opt.content_disposition = true;
opt.max_redirect = 20;
}
\f
if (!home)
{
-#ifndef WINDOWS
+#if defined(MSDOS)
+ /* Under MSDOS, if $HOME isn't defined, use the directory where
+ `wget.exe' resides. */
+ const char *_w32_get_argv0 (void); /* in libwatt.a/pcconfig.c */
+ char *p, buf[PATH_MAX];
+
+ strcpy (buf, _w32_get_argv0 ());
+ p = strrchr (buf, '/'); /* djgpp */
+ if (!p)
+ p = strrchr (buf, '\\'); /* others */
+ assert (p);
+ *p = '\0';
+ home = buf;
+#elif !defined(WINDOWS)
/* If HOME is not defined, try getting it from the password
file. */
struct passwd *pwd = getpwuid (getuid ());
if (!pwd || !pwd->pw_dir)
return NULL;
home = pwd->pw_dir;
-#else /* WINDOWS */
+#else /* !WINDOWS */
/* Under Windows, if $HOME isn't defined, use the directory where
`wget.exe' resides. */
home = ws_mypath ();
return true;
}
-#ifndef WINDOWS
-# define ISSEP(c) ((c) == '/')
-#else
+#if defined(WINDOWS) || defined(MSDOS)
# define ISSEP(c) ((c) == '/' || (c) == '\\')
+#else
+# define ISSEP(c) ((c) == '/')
#endif
/* Like the above, but handles tilde-expansion when reading a user's
*pstring = concat_strings (home, "/", val, (char *) 0);
}
-#ifdef WINDOWS
+#if defined(WINDOWS) || defined(MSDOS)
/* Convert "\" to "/". */
{
char *s;