diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 13:36:33 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | fea3f2c5abf14aada5d9187b82985e51eb5b7a98 (patch) | |
| tree | 6dd3c54c8aaa1ad5941a74200b18da12e512b7fb /src/exec.zig | |
| parent | be5f559939fc11cbfba95b4a7d518816bec8677a (diff) | |
| download | pardes-fea3f2c5abf14aada5d9187b82985e51eb5b7a98.tar.gz pardes-fea3f2c5abf14aada5d9187b82985e51eb5b7a98.zip | |
A path with a part over 255 bytes is refused, never a panic
std's statFile takes the kernel's ENAMETOOLONG for a bug (errnoBug), so a name, look, DumpDir or Save path with a part over 255 bytes panicked the editor (exec.kindOf via writeName, recentKeeps, dumpFailed). Every non-test statFile now goes through fs.statPath, which refuses such a name as NameTooLong first; fs.py drives long, looping, not-a-directory and not-ours paths through name, look, DumpDir, Dump and Save.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/exec.zig b/src/exec.zig index 88c0705d..4785e7a2 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -391,7 +391,7 @@ pub fn isDirectory(path: []const u8) bool { const z = std.fmt.bufPrintSentinel(&buf, "{s}", .{path}, 0) catch return false; pardes.turn.yield(); defer pardes.turn.back(); - const stat = std.Io.Dir.cwd().statFile(std.Io.Threaded.global_single_threaded.io(), z, .{}) catch return false; + const stat = @import("fs.zig").statPath(std.Io.Threaded.global_single_threaded.io(), z, .{}) catch return false; return stat.kind == .directory; } @@ -407,7 +407,7 @@ pub fn kindOf(path: []const u8) ?std.Io.File.Kind { const z = std.fmt.bufPrintSentinel(&buf, "{s}", .{path}, 0) catch return null; pardes.turn.yield(); defer pardes.turn.back(); - const stat = std.Io.Dir.cwd().statFile(std.Io.Threaded.global_single_threaded.io(), z, .{}) catch return null; + const stat = @import("fs.zig").statPath(std.Io.Threaded.global_single_threaded.io(), z, .{}) catch return null; return stat.kind; } |
