1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 12:59:41 +01:00

Don't lose Error.pm if $@ gets clobbered.

In older Perls, sometimes $@ can become unset between the eval and
checking $@.  Its safer to check the eval directly.

Signed-off-by: Michael G Schwern <schwern@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
This commit is contained in:
Michael G. Schwern 2012-07-24 20:21:10 -07:00 committed by Eric Wong
parent 4c8e5c55c2
commit 0ed8fdcdfd

View file

@ -41,8 +41,7 @@ my %pm = (
# We come with our own bundled Error.pm. It's not in the set of default
# Perl modules so install it if it's not available on the system yet.
eval { require Error };
if ($@ || $Error::VERSION < 0.15009) {
if ( !eval { require Error } || $Error::VERSION < 0.15009) {
$pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
}