[Jifty-commit] r1114 - jifty/trunk/lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue May 23 21:06:42 EDT 2006


Author: audreyt
Date: Tue May 23 21:06:41 2006
New Revision: 1114

Modified:
   jifty/trunk/lib/Jifty/Dispatcher.pm

Log:
* Jifty::Dispatcher - proper support for {alter,nations} and [a-z].
  Previously they were not compiled when the pattern had no * nor ?.

Modified: jifty/trunk/lib/Jifty/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Dispatcher.pm	(original)
+++ jifty/trunk/lib/Jifty/Dispatcher.pm	Tue May 23 21:06:41 2006
@@ -903,7 +903,7 @@
     $cond =~ s{/$}{};
 
     my $has_capture = ( $cond =~ / \\ [*?] /x);
-    if ($has_capture) {
+    if ($has_capture or $cond =~ / \\ [[{] /x) {
         $cond = $self->_compile_glob($cond);
     }
 
@@ -1024,8 +1024,7 @@
     }{$self->_unescape($1)}egx;
     $glob =~ s{
         # Braces denote alternations
-        (
-            \\ \{           # opening
+        \\ \{ (         # opening (not part of expression)
             (?:             # one or more characters:
                 \\ \\ \\ \} # ...escaped closing brace
             |
@@ -1033,9 +1032,8 @@
             |
                 [^\\]       # ...normal
             )+
-            \\ \}           # closing
-        )
-    }{'(?:'.join('|', split(/,/, $1)).')'}egx;
+        ) \\ \}         # closing (not part of expression)
+    }{'(?:'.join('|', split(/\\,/, $1)).')'}egx;
     $glob;
 }
 


More information about the Jifty-commit mailing list