Skip to content

Commit 0ed8fdc

Browse files
schwernEric Wong
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Eric Wong <[email protected]>
1 parent 4c8e5c5 commit 0ed8fdc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

perl/Makefile.PL

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ my %pm = (
4141

4242
# We come with our own bundled Error.pm. It's not in the set of default
4343
# Perl modules so install it if it's not available on the system yet.
44-
eval { require Error };
45-
if ($@ || $Error::VERSION < 0.15009) {
44+
if ( !eval { require Error } || $Error::VERSION < 0.15009) {
4645
$pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
4746
}
4847

0 commit comments

Comments
 (0)