From 6820ed1f7f13347c8134b4678ce6c4d403482681 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Sat, 27 Jan 2007 10:45:34 +0000 Subject: Add the O_TRUNC flag when writing the modified file back to disk - fixes FS #6559 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12122 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/text_editor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c index 449a88aa0a..bf69acff93 100644 --- a/apps/plugins/text_editor.c +++ b/apps/plugins/text_editor.c @@ -175,7 +175,7 @@ void save_changes(int overwrite) rb->kbd_input(filename,MAX_PATH); } - fd = rb->open(filename,O_WRONLY|O_CREAT); + fd = rb->open(filename,O_WRONLY|O_CREAT|O_TRUNC); if (fd < 0) { rb->splash(HZ*2,1,"Changes NOT saved"); -- cgit v1.2.3