fix bugs with scripts not restoring properly

This commit is contained in:
Lisa Milne 2023-12-18 12:02:07 +10:00
parent e478a13f61
commit a6cfae3762

View file

@ -2567,8 +2567,14 @@ clite.vfs = {
if (!n)
return false;
}
if (clite.lib.getFileType({node:n}) != type)
return false;
let ntype = clite.lib.getFileType({node:n});
if (ntype != type) {
if (!(
(ntype == clite.io.types.FT_SCRIPT || ntype == clite.io.types.FT_TEXT)
&& (type == clite.io.types.FT_SCRIPT || type == clite.io.types.FT_TEXT)
))
return false;
}
n.uid = uid;
n.gid = gid;