# bugfix: was triggering write-to-mod feature for all file writes due to incorrect flag comparison (2 bits must both be set)

This was SVN commit r3824.
This commit is contained in:
janwas
2006-04-27 03:11:45 +00:00
parent 641e55fefd
commit dfed3ac186
+5 -1
View File
@@ -289,7 +289,11 @@ static LibError VFile_reload(VFile* vf, const char* V_path, Handle)
return err;
}
if(flags & FILE_WRITE_TO_MOD)
// careful! FILE_WRITE_TO_MOD consists of 2 bits; they must both be
// set (one of them is FILE_WRITE, which can be set independently).
// this is a bit ugly but better than requiring users to write
// FILE_WRITE|FILE_WRITE_TO_MOD.
if((flags & FILE_WRITE_TO_MOD) == FILE_WRITE_TO_MOD)
RETURN_ERR(set_mount_to_mod_target(tf));
RETURN_ERR(xfile_open(V_path, flags, tf, &vf->f));