diff options
author | rsc <devnull@localhost> | 2006-02-11 23:38:55 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-02-11 23:38:55 +0000 |
commit | b5f65921f346e6b4335f77e457ac5bcae0ab9d67 (patch) | |
tree | d85d6da9def0b62b51537bf6348b43252ad69f5f /src/cmd/upas/scanmail/common.c | |
parent | e4d832222ba5519db94c7512c1fb82bd32491120 (diff) | |
download | plan9port-b5f65921f346e6b4335f77e457ac5bcae0ab9d67.tar.gz plan9port-b5f65921f346e6b4335f77e457ac5bcae0ab9d67.tar.bz2 plan9port-b5f65921f346e6b4335f77e457ac5bcae0ab9d67.zip |
various cleanup
Diffstat (limited to 'src/cmd/upas/scanmail/common.c')
-rw-r--r-- | src/cmd/upas/scanmail/common.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/upas/scanmail/common.c b/src/cmd/upas/scanmail/common.c index b6ea720d..eab9e2fc 100644 --- a/src/cmd/upas/scanmail/common.c +++ b/src/cmd/upas/scanmail/common.c @@ -585,15 +585,15 @@ matchpat(Pattern *p, char *message, Resub *m) if(c1 == spat->c1) if(memcmp(s, spat->string, spat->len) == 0) if(!isalt(message, spat->alt)){ - m->sp = s; - m->ep = s + spat->len; + m->s.sp = s; + m->e.ep = s + spat->len; return 1; } } } return 0; } - m->sp = m->ep = 0; + m->s.sp = m->e.ep = 0; if(regexec(p->pat, message, m, 1) == 0) return 0; if(isalt(message, p->alt)) @@ -608,23 +608,23 @@ xprint(int fd, char *type, Resub *m) char *p, *q; int i; - if(m->sp == 0 || m->ep == 0) + if(m->s.sp == 0 || m->e.ep == 0) return; /* back up approx 30 characters to whitespace */ - for(p = m->sp, i = 0; *p && i < 30; i++, p--) + for(p = m->s.sp, i = 0; *p && i < 30; i++, p--) ; while(*p && *p != ' ') p--; p++; /* grab about 30 more chars beyond the end of the match */ - for(q = m->ep, i = 0; *q && i < 30; i++, q++) + for(q = m->e.ep, i = 0; *q && i < 30; i++, q++) ; while(*q && *q != ' ') q++; - fprint(fd, "%s %.*s~%.*s~%.*s\n", type, (int)(m->sp-p), p, (int)(m->ep-m->sp), m->sp, (int)(q-m->ep), m->ep); + fprint(fd, "%s %.*s~%.*s~%.*s\n", type, (int)(m->s.sp-p), p, (int)(m->e.ep-m->s.sp), m->s.sp, (int)(q-m->e.ep), m->e.ep); } enum { |