We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd6663a commit 724fee8Copy full SHA for 724fee8
core/src/xmake/io/file_open.c
@@ -192,10 +192,14 @@ tb_int_t xm_io_file_open(lua_State* lua)
192
case 'r': default: mode = TB_FILE_MODE_RO; break;
193
}
194
195
+ // update file?
196
+ tb_bool_t update = !!tb_strchr(modestr, '+');
197
+ if (update && mode == TB_FILE_MODE_RO)
198
+ mode = TB_FILE_MODE_RW;
199
+
200
// get file encoding
201
tb_long_t bomoff = 0;
202
tb_stream_ref_t stream = tb_null;
- tb_bool_t update = !!tb_strchr(modestr, '+');
203
tb_size_t encoding = XM_IO_FILE_ENCODING_UNKNOWN;
204
if (modestr[1] == 'b' || (update && modestr[2] == 'b'))
205
encoding = XM_IO_FILE_ENCODING_BINARY;
0 commit comments