diff options
author | Dave Chapman <dave@dchapman.com> | 2007-01-27 10:45:34 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2007-01-27 10:45:34 +0000 |
commit | 6820ed1f7f13347c8134b4678ce6c4d403482681 (patch) | |
tree | 189d725efb03cf9e531569387cb08a362590a1b5 | |
parent | 1d4c425431d05f90d7206bdc52d0950853469ad9 (diff) | |
download | rockbox-6820ed1f7f13347c8134b4678ce6c4d403482681.tar.gz rockbox-6820ed1f7f13347c8134b4678ce6c4d403482681.zip |
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
-rw-r--r-- | apps/plugins/text_editor.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
175 | rb->kbd_input(filename,MAX_PATH); | 175 | rb->kbd_input(filename,MAX_PATH); |
176 | } | 176 | } |
177 | 177 | ||
178 | fd = rb->open(filename,O_WRONLY|O_CREAT); | 178 | fd = rb->open(filename,O_WRONLY|O_CREAT|O_TRUNC); |
179 | if (fd < 0) | 179 | if (fd < 0) |
180 | { | 180 | { |
181 | rb->splash(HZ*2,1,"Changes NOT saved"); | 181 | rb->splash(HZ*2,1,"Changes NOT saved"); |