puppetlabs/puppet — pull request #470 by daniel-pittman (2012-02-07 21:06:04+00:00)
Title: Bug/2.7.x/12479 bad undef vs regex match behaviour

As part of commit 53869e99 we did work to make the behaviour of variables that
were explicitly `undef` at least somewhat saner.

One unintended side-effect of this was that we started matching `undef` as the
literal string `undef`, not as the empty string, and not "not matching".

Either of the later would have been sane things to do; this fixes that by
picking "match undef as empty string".

That is for consistency: we already match the *literal* empty string as equal
to undef, so it makes sense to treat it the same way for a regular expression.
(Debate on that point is welcome elsewhere, but we should change literal and
regexp matching the same, consistent way if we change it anywhere.)

Signed-off-by: Daniel Pittman