Author Topic: Bug (?) in wxFile::Write() causes bug in the svn-version 5027 into my repo  (Read 3399 times)

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
I patched the svn-source used into my repository to fix this bug: Linux file save permission bug.

Unfortunately there seems to be a bug (maybe it's wanted, but not documented) in the wxFile::Write()-function used by C::B (at least on linux <edit>and windows</edit>).

If a file is opened with the flag "wxFile::write" wxWidgets overwrites the whole file, no matter if the newly written file is shorter then the one on the disk,
if it is opened with the flag  "wxFile::read_write" only the amaount of the new data gets overwritten, that means if the newly written file is shorter then the one on the disk, the last lines/characters remain. the cbEditor does not update it's buffer from disk after writing, so the garbage at the end of the file gets visible first if the file is newly opened, but it can not be compiled.

I haven't been at home the last week, so I could not react earlier (I did not even know anything of the bug until yesterday at 9pm).

I'm just compiling a new svn-version (r5045) with a corrected patch, and will upload it this afternoon (will take about 2 hours due to ISDN).

I'm sorry for the inconvenience and hope that this will not happen again.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
I just uploaded the new version (svn r5045) to my server.