Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  


Pages: [1]   Go Down

Author Topic: [Problem] Module Compilation?  (Read 5637 times)

0 Members and 1 Guest are viewing this topic.


  • Guest
[Problem] Module Compilation?
« on: March 03, 2006, 03:43:19 AM »

For some reason I'm having some huge trouble with compiling modules. I'm running Windows XP SP2 and Anope 1.7.13. I've managed to get some select modules to compile and all... (others fail out because they are unable to find external links), but the ones that do compile have one strange flaw: They don't accept arguments.

Take for instance ircd_oper.c:

int my_os_oplist(User* u)
   char* szSubcommand = 0;
   char* szLogin = 0;
   char* szPass = 0;
   char* szType = 0;
   szSubcommand = strtok(NULL, " ");
   if (!szSubcommand) {
      notice_user(s_NickServ, u, "No Subcommand Specified");

Note that the syntax for the command is /NS OPLIST ADD <etc...>. The "No Subcommand Specified" code should only activate if there is no command after OPLIST. However, no matter how hard I type "ADD" or whatever, it always ends up executing that code. I've never written any modules so I don't know what could be causing it... but this is only an example. Every single module that requires arguments (os_qakill, etc) have this same problem.

Any ideas?

(If my information was vague or insufficient please let me know. In case it interests anybody, I also had trouble in the overall compile of Anope with the /lang section. Had to completely disable compiling of that folder.)


[Edited on 3-3-2006 by dragoonkain]


  • Guest
(No subject)
« Reply #1 on: March 03, 2006, 05:26:18 PM »

Sorry for the repost. I modified the source of the module to use the

char *text = NULL;
text = moduleGetLastBuffer();

strtok(text, ' ');

way of doing things... but I'm confused as to why I had to make change in the first place. If I had to do that then the ircd_oper module must never have worked in the first place, right? That or it was designed for 1.6? Anyway, that's all. Thanks.

Dave Robson

  • Team
  • *
  • Offline Offline
  • Posts: 357
(No subject)
« Reply #2 on: March 03, 2006, 06:21:02 PM »

Modules should never use strtok() - it will just break things later.
Pages: [1]   Go Up