Skip to content

Commit f9ad3ac

Browse files
committed
WIP
1 parent ae7cba1 commit f9ad3ac

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

runtime/js/fs_node.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,22 @@ if (globalThis.process?.platform === "win32") {
152152
: null;
153153
if (
154154
source_stats &&
155-
!source_stats.isDirectory() &&
155+
source_stats.isDirectory() &&
156156
target_stats &&
157-
target_stats.isDirectory()
157+
!target_stats.isDirectory()
158158
) {
159159
var err = new Error("rename");
160160
err.code = 26;
161-
err.path = o;
161+
err.path = n;
162162
this.raise_nodejs_error(err, raise_unix);
163163
}
164-
if (target_stats && target_stats.isDirectory())
164+
if (
165+
source_stats &&
166+
source_stats.isDirectory() &&
167+
target_stats &&
168+
target_stats.isDirectory() &&
169+
!target.startsWith(source)
170+
)
165171
try {
166172
this.fs.rmdirSync(target);
167173
} catch {}

0 commit comments

Comments
 (0)