summaryrefslogtreecommitdiff
path: root/src/process.c
diff options
context:
space:
mode:
authorcertus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-03-13 16:02:30 +0000
committercertus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-03-13 16:02:30 +0000
commitba935451d8eb2e90d334676f06c5bf5c8898a4f0 (patch)
tree6049484751921257a26a9598449c06b39856cbf0 /src/process.c
parent663b243c593f1beb713e97d248f7d6586777e777 (diff)
BUILD : 1.7.13 (1007)# BUGS : 476 # NOTES : Applied Trystan's patch.
git-svn-id: svn://svn.anope.org/anope/trunk@1007 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@732 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/process.c b/src/process.c
index bc2876107..bde7dda20 100644
--- a/src/process.c
+++ b/src/process.c
@@ -20,7 +20,6 @@ extern char *mod_current_module_name;
extern User *mod_current_user;
extern char *mod_current_buffer;
/*************************************************************************/
-/*************************************************************************/
/* Use ignore code? */
int allow_ignore = 1;
@@ -140,7 +139,6 @@ IgnoreData *get_ignore(const char *nick)
}
/*************************************************************************/
-/*************************************************************************/
/* split_buf: Split a buffer into arguments and store the arguments in an
* argument vector pointed to by argv (which will be malloc'd
@@ -248,16 +246,21 @@ void process()
av[0] to see if its a service nick if so assign mod_current_buffer the
value from AV[1] else just assign av[0] - TSL */
/* First check if the ircd proto module overrides this -GD */
+ /* fix to moduleGetLastBuffer() bug 476:
+ fixed in part by adding {} to nickIsServices()
+ however if you have a pseudo they could not use moduleGetLastBuffer()
+ cause they are not part of nickIsServices, even those the ac count is 2
+ that was ignored and only the first param was passed on which is fine for
+ Bahmut ircd aliases but not for pseudo clients on. So additional logic is
+ that if the ac is greater then 1 copy av[1] else copy av[0]
+ I also changed from if statments, cause attempting to access a array member
+ that is not set can lead to odd things - TSL (3/12/06) */
if (!anope_set_mod_current_buffer(ac, av)) {
- if (av[0]) {
+ if (ac >= 1) {
if (nickIsServices(av[0], 1)) {
- if (av[1]) {
- mod_current_buffer = sstrdup(av[1]);
- } else {
- mod_current_buffer = sstrdup(av[0]);
- }
+ mod_current_buffer = (ac > 1 ? sstrdup(av[1]) : sstrdup(av[0]));
} else {
- mod_current_buffer = sstrdup(av[0]);
+ mod_current_buffer = (ac > 1 ? sstrdup(av[1]) : sstrdup(av[0]));
}
} else {
mod_current_buffer = NULL;