FS#6559 - text_editor doesn't make files smaller

Attached to Project: Rockbox
Opened by Tomasz Moń (desowin) - Sunday, 21 January 2007, 22:16 GMT
Task Type Bugs
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


How to reproduce:

1.Open text_editor
2.Type AAAA
3.Save file
4.Open it, and delete 3 'A', then type 'B' twice
5.Save file
6.file will have "ABBA" text instead of expected "ABB"

It hapens with bigger files too, adding characters to file makes file size bigger

I'm using iPod mini 2g
This task depends upon

Closed by  Dave Chapman (linuxstb)
Saturday, 27 January 2007, 10:46 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fix committed to SVN - revision 12122, thanks for the bug report.
Comment by Calum Mackay (cdmackay) - Monday, 22 January 2007, 14:51 GMT
yup, I've been seeing this on H340.
Comment by Dave Chapman (linuxstb) - Saturday, 27 January 2007, 01:50 GMT
The fix for this seems to be to just add O_TRUNC to the rb->open() call in line 178 of text_editor.c

Can anyone confirm?
Comment by Tomasz Moń (desowin) - Saturday, 27 January 2007, 09:52 GMT
I confirm this, it's fixed then