https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109830
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Gaius Mulley <ga...@gcc.gnu.org>: https://gcc.gnu.org/g:55156f50e7c14d63f6c31a65cfdf61c1de33359d commit r13-7634-g55156f50e7c14d63f6c31a65cfdf61c1de33359d Author: Gaius Mulley <gaiusm...@gmail.com> Date: Fri Jul 28 21:08:29 2023 +0100 PR modula2/109830 m2iso library SeqFile.mod appending to a file overwrites content This patch is for the m2iso library SeqFile.mod to fix a bug when a file is opened using OpenAppend. The patch checks to see if the file exists and it uses FIO.OpenForRandom to ensure the file is not overwritten. gcc/m2/ChangeLog: PR modula2/109830 * gm2-libs-iso/SeqFile.mod (newCid): New parameter toAppend used to select FIO.OpenForRandom. (OpenRead): Pass extra parameter to newCid. (OpenWrite): Pass extra parameter to newCid. (OpenAppend): Pass extra parameter to newCid. gcc/testsuite/ChangeLog: PR modula2/109830 * gm2/isolib/run/pass/seqappend.mod: New test. (cherry picked from commit 1953c0cfb006a696723baa7d5ea14038f6d901a4) Signed-off-by: Gaius Mulley <gaiusm...@gmail.com>