[srvx-commits] CVS: services/src modcmd.c,1.25,1.26
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2002-09-16 14:54:04
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv1718/src
Modified Files:
modcmd.c
Log Message:
check for null modcmd functions and report them as errors
Index: modcmd.c
===================================================================
RCS file: /cvsroot/srvx/services/src/modcmd.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** modcmd.c 15 Sep 2002 00:01:12 -0000 1.25
--- modcmd.c 16 Sep 2002 14:54:01 -0000 1.26
***************
*** 44,47 ****
--- 44,48 ----
#define MCMSG_COMMAND_BINDING "%s is a binding of: %s"
#define MCMSG_ALIAS_ERROR "Error in alias expansion for %s; check the error log for details."
+ #define MCMSG_INTERNAL_COMMAND "$b%s$b is an internal command and cannot be called directly; please check command bindings."
#define MCMSG_UNKNOWN_SERVICE "Unknown service %s."
#define MCMSG_ALREADY_BOUND "%s already has a command bound as %s."
***************
*** 683,686 ****
--- 684,691 ----
if (argc < cmd.command->min_argc) {
send_message(user, service->bot, MSG_MISSING_PARAMS, cmd.name);
+ return 0;
+ }
+ if (!cmd.command->func) {
+ send_message(user, service->bot, MCMSG_INTERNAL_COMMAND, cmd.name);
return 0;
}
|