Perl-Toolchain-Gang / ExtUtils-MakeMaker

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

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

Open jkeenan opened 1 year ago

jkeenan commented 1 year 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 1 year 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 1 year 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.