From df553e722fc97af5179bbcaee2ee0c97a45a61db Mon Sep 17 00:00:00 2001 From: Epoch Qwert Date: Sun, 26 Oct 2014 02:39:15 -0500 Subject: made some new messages debug messages. fixed... fuck. I forgot. check the diff. you know how to read source code. :P --- segfault.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/segfault.c b/segfault.c index 98b7834..2979de6 100644 --- a/segfault.c +++ b/segfault.c @@ -328,13 +328,22 @@ void file_tail(int fd,char *from,char *file,char *args,char opt,struct user *use if(i == MAXTAILS -1) { exit(3); } + if(*file == '#') { + from=file; + file=strchr(file,':'); + if(file) {*file=0; + file++; + } + } if((fdd=open(file,O_RDONLY|O_NONBLOCK,0)) == -1) { snprintf(tmp,sizeof(tmp)-1,"file_tail: %s: (%s) fd:%d",strerror(errno),file,fdd); privmsg(fd,"#cmd",tmp); return; } - snprintf(tmp,sizeof(tmp)-1,"file_tail opened file '%s' with fd: %d / %d",file,fdd,maxtails); - privmsg(fd,"#cmd",tmp); + if(debug) { + snprintf(tmp,sizeof(tmp)-1,"file_tail opened file '%s' with fd: %d / %d",file,fdd,maxtails); + privmsg(fd,"#cmd",tmp); + } fstat(fdd,&st); // <-- is this needed? /*for(j=0;j