From b8e9d096edb03d9eef95dedbb81d4135ba6da551 Mon Sep 17 00:00:00 2001 From: mcuelenaere Date: Sun, 6 Sep 2009 21:41:48 +0000 Subject: [PATCH] Lua plugin: fix bad behaviour for io.open(path, 'w') Author: Christophe Gragnic Patch: FS#10592 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22645 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/lua/liolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/plugins/lua/liolib.c b/apps/plugins/lua/liolib.c index 08aed4238..eea40c0d0 100644 --- a/apps/plugins/lua/liolib.c +++ b/apps/plugins/lua/liolib.c @@ -151,7 +151,7 @@ static int io_open (lua_State *L) { case 'r': flags = O_RDONLY; break; case 'w': - flags = O_WRONLY; break; + flags = O_WRONLY | O_TRUNC; break; case 'a': flags = O_WRONLY | O_APPEND; break; } -- 2.11.4.GIT