fix botch in nupas conversion. need to set the file name after finding the match. Reference: /n/atom/patch/applied/filterfix Date: Sat Mar 1 23:24:44 CET 2014 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/upas/send/filter.c Sat Mar 1 23:24:20 2014 +++ /sys/src/cmd/upas/send/filter.c Sat Mar 1 23:24:21 2014 @@ -34,7 +34,7 @@ void usage(void) { - fprint(2, "usage: upas/filter [-bh] rcvr mailbox [regexp file] ...\n"); + fprint(2, "usage: upas/filter [-nbh] rcvr mailbox [regexp file] ...\n"); exits("usage"); } @@ -50,6 +50,9 @@ header = body = 0; ARGBEGIN { + case 'n': + flagn = 1; + break; case 'h': header = 1; break; @@ -73,9 +76,6 @@ mp->sender = s_copy(cp); } - dp = d_new(s_copy(argv[0])); - dp->repl1 = s_copy(argv[1]); - strecpy(file, file+sizeof file, argv[1]); cp = findbody(s_to_c(mp->body)); for(i = 2; i < argc; i += 2){ @@ -95,6 +95,8 @@ break; } } + dp = d_new(s_copy(argv[0])); + dp->repl1 = s_copy(file); if(cat_mail(dp, mp) != 0) exits("fail"); exits("");