[Bps-public-commit] r16062 - in Path-Dispatcher/trunk: lib/Path/Dispatcher/Rule

sartak at bestpractical.com sartak at bestpractical.com
Thu Sep 25 15:28:05 EDT 2008


Author: sartak
Date: Thu Sep 25 15:28:05 2008
New Revision: 16062

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm

Log:
 r72465 at onn:  sartak | 2008-09-25 15:28:01 -0400
 Avoid undef warnings and possible false positives by bailing out if we run out of input


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm	Thu Sep 25 15:28:05 2008
@@ -49,6 +49,7 @@
     my @tokens = @orig_tokens;
 
     for my $expected ($self->tokens) {
+        return unless @tokens; # too few words
         my $got = shift @tokens;
         return unless $self->_match_token($got, $expected);
     }



More information about the Bps-public-commit mailing list