#-h- malfix.r 1322 asc 28-oct-80 09:15:33 #-h- malfix.q 542 asc 28-oct-80 09:15:19 subroutine main integer getpat, s, getlin, match character hdrpat(100), buf(MAXLINE) string hdptrn "%Mail from" if (getpat(hdptrn, hdrpat) == ERR) call error("Something wrong with pattern.") # for (s = getlin(buf, STDIN); s != EOF; s = getlin(buf, STDIN)) # if (match(buf, hdrpat) == YES) # break # if (s != EOF) # repeat while (getlin(buf, STDIN) != EOF) { if (match(buf, hdrpat) == YES) call refrmt(buf, STDOUT) else call putlin(buf, STDOUT) # s = getlin(buf, STDIN) } # until (s == EOF) return end #-h- refrmt.q 682 asc 28-oct-80 09:15:20 subroutine refrmt(buf, unit) character buf(ARB), user(FILENAMESIZE), date(FILENAMESIZE), time(FILENAMESIZE), header(4) integer junk, getwrd, i string datehd "Date: " string fromhd "From: " string pst " - PST" data header/1, 1, NEWLINE, EOS/ i = 1 junk = getwrd(buf, i, user) junk = getwrd(buf, i, user) junk = getwrd(buf, i, user) junk = getwrd(buf, i, date) junk = getwrd(buf, i, time) call putlin(header, unit) call putlin(datehd, unit) call putlin(date, unit) call putch(BLANK, unit) call putlin(time, unit) call putlin(pst, unit) call putch(NEWLINE, unit) call putlin(fromhd, unit) call putlin(user, unit) call putch(NEWLINE, unit) return end