Skip to content

Commit

Permalink
Fix bug in bind_path
Browse files Browse the repository at this point in the history
Fix bug in bind_path where part of the path might evaluate to false (ex: path=/foo/bar/0)
  • Loading branch information
stevan committed Jun 22, 2016
1 parent 681ce97 commit 375a716
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Web/Machine/Util.pm
Expand Up @@ -37,8 +37,8 @@ sub pair_value { ( values %{ $_[0] } )[0] }

sub bind_path {
my ($spec, $path) = @_;
my @parts = grep { $_ } split /\// => $path;
my @spec = grep { $_ } split /\// => $spec;
my @parts = grep defined $_, split /\// => $path;
my @spec = grep defined $_, split /\// => $spec;

my @results;
foreach my $i ( 0 .. $#spec ) {
Expand Down

0 comments on commit 375a716

Please sign in to comment.