Perl-Toolchain-Gang / ExtUtils-MakeMaker

Perl module to make Makefiles and build modules (what backs Makefile.PL)
https://metacpan.org/release/ExtUtils-MakeMaker
64 stars 76 forks source link

maybe_command(): Ensure that command is defined and non-empty #449

Open jkeenan opened 9 months ago

jkeenan commented 9 months ago

As demonstrated in https://github.com/cpan-testers/CPAN-Reporter/issues/59#issuecomment-1753729292, it is possible to exercise subroutine maybe_command() without a defined argument. We should preclude this from happening.

haarg commented 9 months ago

This doesn't look right to me. The current maybe_command method is signaling failure by returning false, but this is making it sometimes throw an exception.

jkeenan commented 9 months ago

This doesn't look right to me. The current maybe_command method is signaling failure by returning false, but this is making it sometimes throw an exception.

Correct. I have revised the subroutine call and the tests. Please re-review.