aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2015-05-14 06:53:15 -0500
committerepochqwert <epoch@hacking.allowed.org>2015-05-14 06:53:15 -0500
commit1432454e2c60cd12e35739e217dfb1c3ead19a41 (patch)
treeacbce9995d68e04f881f6158a1188e85544c6d60
parent3b1466afd58e7cfbf5be09df8cfc52409171f5d3 (diff)
downloadsegfault-1432454e2c60cd12e35739e217dfb1c3ead19a41.tar.gz
segfault-1432454e2c60cd12e35739e217dfb1c3ead19a41.zip
fixed small change in Makefile and segfault.c
-rw-r--r--Makefile2
-rw-r--r--segfault.c12
2 files changed, 9 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 5111042..0851a71 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-LDFLAGS=-lirc -Llibirc -lhashtable -Llibhashtable
+LDFLAGS=-lirc -lhashtable
CFLAGS=-std=c99 -pedantic -Wall
all:
diff --git a/segfault.c b/segfault.c
index bd2a427..535b0ba 100644
--- a/segfault.c
+++ b/segfault.c
@@ -1035,8 +1035,8 @@ void message_handler(int fd,char *from,struct user *user,char *msg,int redones)
debug_time(fd,from,"checking aliases...");
command--;// :>
if((m=ht_getnode(&alias,command)) != NULL) {
- sz=(strlen(msg)-strlen(m->original)+strlen(m->target)+1);
- redo=format_magic(fd,from,user,m->target,*(msg+strlen(m->original)+1)=='\n'?"":(msg+strlen(m->original)+1));
+ sz=(strlen(command)-strlen(m->original)+strlen(m->target)+1);
+ redo=format_magic(fd,from,user,m->target,*(command+strlen(m->original)+1)=='\n'?"":(command+strlen(m->original)+1));
message_handler(fd,from,user,redo,redones+1);
free(redo);
redo=0;
@@ -1062,6 +1062,9 @@ void line_handler(int fd,char *line) {//this should be built into the libary?
if(recording_raw) {
append_file(fd,"epoch",RAWLOG,line,'\n');
}
+ char *line2=strdup(line);
+ char *line3;
+ struct entry *tmp2;
//line will be mangled by the cutter.
char **a=line_cutter(fd,line,user);
if(!user->user && a[0]) { //server message
@@ -1072,18 +1075,19 @@ void line_handler(int fd,char *line) {//this should be built into the libary?
strcpy(tmp,"!###");
// privmsg(fd,*a[1]=='#'?a[1]:user->nick,a[0]);
}
- if(ht_getnode(&alias,tmp) != NULL) {
+ if((tmp2=ht_getnode(&alias,tmp)) != NULL) {
strcat(tmp," ");
- strcat(tmp,a[2]);//lol. fixme.
user->nick=strdup("epoch");
user->user=strdup("epoch");
user->host=strdup("localhost");
+ strcat(tmp,line2);
message_handler(fd,"#cmd",user,tmp,1);
free(user->nick);
free(user->user);
free(user->host);
}
}
+ free(line2);
if(a[0] && a[1] && a[2]) {
if(!strcmp(a[0],"PRIVMSG") && strcmp(user->nick,myuser->nick)) {
if(strcmp(user->nick,myuser->nick)) {