Mail fix utility

Author: Unknown
File Name: MAIL.FIX.SEG.S
—————————————————————————————————————————–

; mailfix program

home
 print \"Make sure disk containing mail file is"
 input @2 "on-line. Press [RETURN] to begin..." i$

ready "e:mail"
 if info(6)<29 goto dofix

print \"Your mail file is OK and does not need"
 print "to be fixed."\
 close:end

dofix
 ready "e:"
 open #1,"e:mail"
 a=size(1)*2
 read #1,ram,8
 poke ram+2,a mod 256
 poke ram+3,a/256
 mark(1)=0
 write #1,ram,8
 close

q$=chr$(34)
 print \"Your mail file has now been repaired."\
 print "To prevent further problems, go into"
 print "MAIN.SEG and find the label TERM3."
 print "Approximately 5 lines after the label"
 print "you will find the line:"\
 print " if ma ready "q$"e:mail"q$":kill #msg(un):update"
 print \"Change it to read:"\
 print " if ma ready "q$"e:mail"q$":kill #msg(un):msg(un)=0:update"
 print \"Once changed, this will eliminate the"
 print "cause of the 'Mail Bit-Map Full'."
 end