-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: segfault action: commit revision: path_from: revision_from: 1432454e2c60cd12e35739e217dfb1c3ead19a41: path_to: revision_to:
commit 1432454e2c60cd12e35739e217dfb1c3ead19a41 Author: epochqwert <epoch@hacking.allowed.org> Date: Thu May 14 06:53:15 2015 -0500 fixed small change in Makefile and segfault.c diff --git a/Makefile b/Makefile
--- 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
--- 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)) {
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 18:48:47 2024