diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/lua/liolib.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/plugins/lua/liolib.c b/apps/plugins/lua/liolib.c index 0651ca971e..08aed42388 100644 --- a/apps/plugins/lua/liolib.c +++ b/apps/plugins/lua/liolib.c | |||
@@ -156,6 +156,8 @@ static int io_open (lua_State *L) { | |||
156 | flags = O_WRONLY | O_APPEND; break; | 156 | flags = O_WRONLY | O_APPEND; break; |
157 | } | 157 | } |
158 | } | 158 | } |
159 | if((*mode == 'w' || *mode == 'a') && !rb->file_exists(filename)) | ||
160 | flags |= O_CREAT; | ||
159 | *pf = rb->open(filename, flags); | 161 | *pf = rb->open(filename, flags); |
160 | return (*pf < 0) ? pushresult(L, 0, filename) : 1; | 162 | return (*pf < 0) ? pushresult(L, 0, filename) : 1; |
161 | } | 163 | } |