### `<setenv>`
variable1=contents1
variable2=contents2
+ variable3
Set the given environment variables to the specified value before the actual
-command is run. They are cleared again after the command has been run.
+command is run. They are restored back to their former values again after the
+command has been run.
+
+If the variable name has no assignment, no `=`, then that variable is just
+deleted.
### `<command [option="no-output/no-include/force-output/binary-trace"] [timeout="secs"][delay="secs"][type="perl/shell"]>`
Command line to run.
<keywords>
HTTP
variables
+--config
</keywords>
</info>
#
# Client-side
<client>
+
+# For unknown reasons, a number of CI jobs on Appveyor keep returning NULL to
+# getenv() for the blank environment variable which makes the test fail.
+# Unfortunately, this makes me disable the test completely on Windows.
+
+<features>
+!win32
+</features>
<server>
http
</server>
my @setenv = getpart("client", "setenv");
foreach my $s (@setenv) {
chomp $s;
- if($s =~ /([^=]*)=(.*)/) {
+ if($s =~ /([^=]*)(.*)/) {
my ($var, $content) = ($1, $2);
# remember current setting, to restore it once test runs
$oldenv{$var} = ($ENV{$var})?"$ENV{$var}":'notset';
- # set new value
- if(!$content) {
- delete $ENV{$var} if($ENV{$var});
- }
- else {
+
+ if($content =~ /^=(.*)/) {
+ # assign it
+ $content = $1;
+
if($var =~ /^LD_PRELOAD/) {
if(exe_ext('TOOL') && (exe_ext('TOOL') eq '.exe')) {
logmsg "Skipping LD_PRELOAD due to lack of OS support\n" if($verbose);
$ENV{$var} = "$content";
logmsg "setenv $var = $content\n" if($verbose);
}
+ else {
+ # remove it
+ delete $ENV{$var} if($ENV{$var});
+ }
+
}
}
if($proxy_address) {