From 6dd1dc8187326b09ccdf051cb632016a03b3f7b6 Mon Sep 17 00:00:00 2001 From: epochqwert Date: Sun, 19 Mar 2017 04:54:31 +0000 Subject: fixed the lambda stuff --- segfault.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/segfault.c b/segfault.c index 084a97f..e04a504 100644 --- a/segfault.c +++ b/segfault.c @@ -20,7 +20,7 @@ #define RECURSE_LIMIT 10 -#define free(a) do{printf("freeing %p line:%d\n",(void *)a,__LINE__);if(a) free(a);}while(0); +//#define free(a) do{printf("freeing %p line:%d\n",(void *)a,__LINE__);if(a) free(a);}while(0); /*// just in case your system doesn't have strndup char *strndup(char *s,int l) { @@ -1094,19 +1094,15 @@ void message_handler(int fd,char *from,struct user *user,char *msg,int redones) if(!strncmp(command,"s/",2)) { command[1]=' '; } + while(!strncmp(command,"lambda ",7)) { + command+=7; + command=format_magic(fd,from,user,command,command); + lambdad=1; + } if((args=strchr(command,' '))) { *args=0; args++; } - while(!strncmp(command,"lambda",6)) { - command+=7; - if((args=strchr(command,' '))) { - *args=0; - args++; - } - args=format_magic(fd,from,user,args,args); - lambdad=1; - } if((lol.data=ht_getvalue(&builtin,command))) { func=lol.func; func(fd,from,args,user); -- cgit v1.2.3