Fixed arguments debug message
Sebastian Riedel [Sun, 13 Nov 2005 02:14:48 +0000 (02:14 +0000)]
lib/Catalyst/DispatchType/Default.pm
lib/Catalyst/Dispatcher.pm

index dba3951..62308c3 100644 (file)
@@ -24,15 +24,16 @@ See L<Catalyst>.
 sub match {
     my ( $self, $c, $path ) = @_;
     return if $path =~ m!/!;    # Not at root yet, wait for it ...
-    my $result = ($c->get_actions('default', $c->req->path))[-1];
+    my $result = ( $c->get_actions( 'default', $c->req->path ) )[-1];
 
     # Find default on namespace or super
     if ($result) {
-        $c->action( $result );
+        $c->action($result);
         $c->namespace( $result->namespace );
         $c->req->action('default');
+
         # default methods receive the controller name as the first argument
-        unshift @{ $c->req->args }, $path;
+        unshift @{ $c->req->args }, $path if $path;
         $c->req->match('');
         return 1;
     }
index 7ba40cc..acd1b59 100644 (file)
@@ -194,7 +194,6 @@ sub prepare_action {
         }
 
         # If not, move the last part path to args
-
         unshift @args, pop @path;
     }