command.c: Fix get_cmd_pointer.
authorAndre Noll <maan@systemlinux.org>
Wed, 31 Oct 2007 00:17:47 +0000 (01:17 +0100)
committerAndre Noll <maan@systemlinux.org>
Wed, 31 Oct 2007 00:17:47 +0000 (01:17 +0100)
The old code did not set the handler for afs commands at all. Bad.

command.c

index e294e87..3a58300 100644 (file)
--- a/command.c
+++ b/command.c
@@ -376,13 +376,16 @@ static struct server_command *get_cmd_ptr(const char *name, char **handler)
        for (cmd = server_cmds; cmd->name; cmd++)
                if (!strcmp(cmd->name, name)) {
                        if (handler)
-                               *handler = para_strdup("para_server"); /* server commands */
+                               *handler = para_strdup("server"); /* server commands */
                        return cmd;
                }
        /* not found, look for commands supported by afs */
        for (cmd = afs_cmds; cmd->name; cmd++)
-               if (!strcmp(cmd->name, name))
+               if (!strcmp(cmd->name, name)) {
+                       if (handler)
+                               *handler = para_strdup("afs");
                        return cmd;
+               }
        return NULL;
 }