Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -r1.44 -r1.45 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 22 Sep 2003 18:45:31 -0000 1.44 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 26 Sep 2003 08:09:07 -0000 1.45 @@ -836,9 +836,8 @@ if { [llength $var_spec] > 1 } { set value [uplevel subst \{[lindex $var_spec 1]\}] - if { !$no_empty_p || ![empty_string_p $value] } { - set exp_value($name) $value - } + set exp_value($name) $value + # If the value is specified explicitly, we include it even if the value is empty } else { upvar 1 $name upvar_variable if { [info exists upvar_variable] } { Index: openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 23 Sep 2003 19:51:38 -0000 1.10 +++ openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 26 Sep 2003 08:09:07 -0000 1.11 @@ -418,3 +418,34 @@ } } } + +aa_register_case export_vars { + Testing export_vars +} { + set foo 1 + set bar {} + + aa_equals "{ foo bar }" \ + [export_vars { foo bar }] \ + "foo=1&bar=" + + aa_equals "-no_empty { foo bar }" \ + [export_vars -no_empty { foo bar }] \ + "foo=1" + + aa_equals "-no_empty { foo bar { baz greble } }" \ + [export_vars -no_empty { foo bar { baz greble } }] \ + "foo=1&baz=greble" + + aa_equals "-no_empty -override { { bar \"\" } } { foo bar }" \ + [export_vars -no_empty -override { { bar "" } } { foo bar }] \ + "foo=1&bar=" \ + + aa_equals "-no_empty -override { { baz greble } } { foo bar }" \ + [export_vars -no_empty -override { baz } { foo bar }] \ + "foo=1" + + aa_equals "-no_empty { foo { bar \"\" } }" \ + [export_vars -no_empty { foo { bar "" } }] \ + "foo=1&bar=" +}