Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/compiler/resinator/compile.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2914,7 +2914,7 @@ fn validateSearchPath(path: []const u8) error{BadPathName}!void {
// (e.g. the NT \??\ prefix, the device \\.\ prefix, etc).
// Those path types are something of an unavoidable way to
// still hit unreachable during the openDir call.
var component_iterator = try std.fs.path.componentIterator(path);
var component_iterator = std.fs.path.componentIterator(path);
while (component_iterator.next()) |component| {
// https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file
if (std.mem.indexOfAny(u8, component.name, "\x00<>:\"|?*") != null) return error.BadPathName;
Expand Down
4 changes: 1 addition & 3 deletions lib/std/Build/Cache.zig
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ fn findPrefixResolved(cache: *const Cache, resolved_path: []u8) !PrefixedPath {
fn getPrefixSubpath(allocator: Allocator, prefix: []const u8, path: []u8) ![]u8 {
const relative = try fs.path.relative(allocator, prefix, path);
errdefer allocator.free(relative);
var component_iterator = fs.path.NativeComponentIterator.init(relative) catch {
return error.NotASubPath;
};
var component_iterator = fs.path.NativeComponentIterator.init(relative);
if (component_iterator.root() != null) {
return error.NotASubPath;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/std/Build/Watch/FsEvents.zig
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub fn setPaths(fse: *FsEvents, gpa: Allocator, steps: []const *std.Build.Step)
}.lessThan);
need_dirs.clearRetainingCapacity();
for (old_dirs) |dir_path| {
var it: std.fs.path.ComponentIterator(.posix, u8) = try .init(dir_path);
var it: std.fs.path.ComponentIterator(.posix, u8) = .init(dir_path);
while (it.next()) |component| {
if (need_dirs.contains(component.path)) {
// this path is '/foo/bar/qux', but '/foo' or '/foo/bar' was already added
Expand Down
2 changes: 1 addition & 1 deletion lib/std/Io/Dir.zig
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ pub const MakePathStatus = enum { existed, created };
/// Same as `makePath` except returns whether the path already existed or was
/// successfully created.
pub fn makePathStatus(dir: Dir, io: Io, sub_path: []const u8) MakePathError!MakePathStatus {
var it = try std.fs.path.componentIterator(sub_path);
var it = std.fs.path.componentIterator(sub_path);
var status: MakePathStatus = .existed;
var component = it.last() orelse return error.BadPathName;
while (true) {
Expand Down
2 changes: 1 addition & 1 deletion lib/std/Io/Threaded.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ fn dirMakeOpenPathWindows(
w.SYNCHRONIZE | w.FILE_TRAVERSE |
(if (options.iterate) w.FILE_LIST_DIRECTORY else @as(u32, 0));

var it = try std.fs.path.componentIterator(sub_path);
var it = std.fs.path.componentIterator(sub_path);
// If there are no components in the path, then create a dummy component with the full path.
var component: std.fs.path.NativeComponentIterator.Component = it.last() orelse .{
.name = "",
Expand Down
Loading