fixed bug before draven finished test case :P
Sebastian Riedel [Thu, 14 Apr 2005 12:57:57 +0000 (12:57 +0000)]
lib/Catalyst/Dispatcher.pm

index fb48acf..76ab83c 100644 (file)
@@ -114,10 +114,10 @@ sub forward {
     my $caller    = caller(0);
     my $namespace = '/';
     if ( $command =~ /^\// ) {
-        $command =~ /^(.*)\/(\w+)$/;
+        $command =~ /^\/(.*)\/(\w+)$/;
         $namespace = $1 || '/';
-        $namespace = s/^\/// if $namespace ne '/';
-        $command = $2;
+        $command   = $2 || $command;
+        $command =~ s/^\///;
     }
     else { $namespace = _class2prefix($caller) || '/' }
     my $results = $c->get_action( $command, $namespace );