diff --git a/images/apple/PLASMA2-SYS.PO b/images/apple/PLASMA2-SYS.PO index 03da6f5..f25a27a 100755 Binary files a/images/apple/PLASMA2-SYS.PO and b/images/apple/PLASMA2-SYS.PO differ diff --git a/images/apple/PLASMA2.2mg b/images/apple/PLASMA2.2mg index c996d54..6b88936 100644 Binary files a/images/apple/PLASMA2.2mg and b/images/apple/PLASMA2.2mg differ diff --git a/src/toolsrc/ed.pla b/src/toolsrc/ed.pla index 1968c90..f4b4738 100755 --- a/src/toolsrc/ed.pla +++ b/src/toolsrc/ed.pla @@ -441,25 +441,35 @@ def writetxt(filename)#0 word i byte refnum, txtbuf[MAXLNLEN+2] - fileio:destroy(filename) - fileio:create(filename, $04, $00) // full access, TXT file - refnum = fileio:open(filename) - if refnum == 0 - return - fin // // Remove blank lines at end of text. // while numlines > 1 and txtlinbuf=>[numlines - 1] == @nullstr; numlines--; loop // - // Write all the text line to the file. + // Delete old file and re-create + // + fileio:destroy(filename) + fileio:create(filename, $04, $00) // full access, TXT file + refnum = fileio:open(filename) + if refnum == 0 + puts("\nError $"); puth(perr); puts(" opening: "); puts(filename); putln + return + fin + // + // Write all the text lines to the file. // for i = 0 to numlines - 1 lncpy(@txtbuf, txtlinbuf=>[i]) - fileio:write(refnum, @txtbuf + 1, txtbuf) + if fileio:write(refnum, @txtbuf + 1, txtbuf) <> txtbuf + puts("\nError $"); puth(perr); puts(" writing: "); puts(filename); putln + fileio:close(refnum) + return + fin if !(i & $0F); putc('.'); fin next - fileio:close(refnum) + if fileio:close(refnum) <> FILE_ERR_OK + puts("\nError $"); puth(perr); puts(" closing: "); puts(filename) + fin putln end //