+2009-04-11 Steven Schubiger <stsc@member.fsf.org>
+
+ * init.c (initialize): Run a custom SYSTEM_WGETRC when
+ provided as an environment variable.
+
2009-02-27 Gisle Vanem <gvanem@broadpark.no>
* main.c (main): "freopen (NULL,.." causes an assertion in MSVC
/* Reading/parsing the initialization file.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Wget.
void
initialize (void)
{
- char *file;
+ char *file, *env_sysrc;
int ok = true;
/* Load the hard-coded defaults. */
defaults ();
-
- /* If SYSTEM_WGETRC is defined, use it. */
+
+ /* Run a non-standard system rc file when the according environment
+ variable has been set. For internal testing purposes only! */
+ env_sysrc = getenv ("SYSTEM_WGETRC");
+ if (env_sysrc && file_exists_p (env_sysrc))
+ ok &= run_wgetrc (env_sysrc);
+ /* Otherwise, if SYSTEM_WGETRC is defined, use it. */
#ifdef SYSTEM_WGETRC
- if (file_exists_p (SYSTEM_WGETRC))
+ else if (file_exists_p (SYSTEM_WGETRC))
ok &= run_wgetrc (SYSTEM_WGETRC);
#endif
/* Override it with your own, if one exists. */
+2009-04-11 Steven Schubiger <stsc@member.fsf.org>
+
+ * run-px: Skip testing with real rc files by setting
+ SYSTEM_WGETRC and WGETRC to /dev/null.
+
2009-02-25 Benjamin Wolsey <bwy@benjaminwolsey.de>
* Makefile.am (run-px-tests): Ensure run-px is run from srcdir.
'Test--spider-r.px',
);
+foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
+ $ENV{$var} = '/dev/null';
+}
+
my @tested;
foreach my $test (@tests) {
push @tested, { name => $test, result => $? };
}
+foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
+ delete $ENV{$var};
+}
+
print "\n";
foreach my $test (@tested) {
($test->{result} == 0)