Permalink
Browse files

Fix /ignore -d bug (i_cull() dissects prefixes)

  • Loading branch information...
1 parent a9bd549 commit e7b2bd5913830d7f4a2d675842d336600e7d984b Sound and Fury committed Sep 19, 2010
Showing with 6 additions and 6 deletions.
  1. +1 −1 Makefile
  2. +5 −5 names.c
View
@@ -55,7 +55,7 @@ config.o: config.c config.h names.h bits.h colour.h text.h version.h
input.o: input.c input.h ttyesc.h names.h buffer.h irc.h bits.h
-names.o: names.c names.h buffer.h
+names.o: names.c names.h buffer.h irc.h
c_init.c: colour.d c_init.awk
$(AWK) -f c_init.awk colour.d > c_init.c
View
@@ -123,11 +123,11 @@ int i_cull(name ** list, char *nm)
if(!list)
return(0);
int rv=0;
- char rm[strlen(nm)+2];
- if(strchr(nm, '@'))
- strcpy(rm, nm);
- else
- sprintf(rm, "%s@", nm);
+ char *pnm=strdup(nm?nm:"");
+ char *src, *user, *host;
+ prefix_split(pnm, &src, &user, &host);
+ char rm[strlen(src)+strlen(user)+strlen(host)+3];
+ sprintf(rm, "%s!%s@%s", src, user, host);
name *curr=*list;
while(curr)
{

0 comments on commit e7b2bd5

Please sign in to comment.