Am 17.11.2015 um 20:06 schrieb Eric Blake: > On 11/17/2015 10:59 AM, Daniel P. Berrange wrote: [...] >> +++ b/configure >> @@ -5925,6 +5925,24 @@ cat <<EOD >config.status >> # Compiler output produced by configure, useful for debugging >> # configure, is in config.log if it exists. >> EOD >> + >> +preserve_env() { >> + envname=$1 >> + >> + if test -n "${!envname}" > Bashism, but configure is /bin/sh. This won't work on dash :( > > I think you'll have to use eval, and we'll just have to audit that > preserve_env can never be called with suspicious text where eval would > open a security hole.
You could also call the function with two arguments ... preserve_env PATH "$PATH" ... and use the 2nd argument in the test.