diff options
Diffstat (limited to 'lib/std/fs')
| -rw-r--r-- | lib/std/fs/File.zig | 2 | ||||
| -rw-r--r-- | lib/std/fs/path.zig | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/fs/File.zig b/lib/std/fs/File.zig index 073ab6777b..2601c7643a 100644 --- a/lib/std/fs/File.zig +++ b/lib/std/fs/File.zig @@ -179,7 +179,7 @@ pub fn isCygwinPty(file: File) bool { // The name we get from NtQueryInformationFile will be prefixed with a '\', e.g. \msys-1888ae32e00d56aa-pty0-to-master return (std.mem.startsWith(u16, name_wide, &[_]u16{ '\\', 'm', 's', 'y', 's', '-' }) or std.mem.startsWith(u16, name_wide, &[_]u16{ '\\', 'c', 'y', 'g', 'w', 'i', 'n', '-' })) and - std.mem.indexOf(u16, name_wide, &[_]u16{ '-', 'p', 't', 'y' }) != null; + std.mem.find(u16, name_wide, &[_]u16{ '-', 'p', 't', 'y' }) != null; } /// Returns whether or not ANSI escape codes will be treated as such, diff --git a/lib/std/fs/path.zig b/lib/std/fs/path.zig index 62324fe5b5..f00007756f 100644 --- a/lib/std/fs/path.zig +++ b/lib/std/fs/path.zig @@ -402,9 +402,9 @@ pub fn windowsParsePath(path: []const u8) WindowsPath { if (path.len >= 2 and PathType.windows.isSep(u8, path[0]) and PathType.windows.isSep(u8, path[1])) { const root_end = root_end: { - var server_end = mem.indexOfAnyPos(u8, path, 2, "/\\") orelse break :root_end path.len; + var server_end = mem.findAnyPos(u8, path, 2, "/\\") orelse break :root_end path.len; while (server_end < path.len and PathType.windows.isSep(u8, path[server_end])) server_end += 1; - break :root_end mem.indexOfAnyPos(u8, path, server_end, "/\\") orelse path.len; + break :root_end mem.findAnyPos(u8, path, server_end, "/\\") orelse path.len; }; return WindowsPath{ .is_abs = true, @@ -722,7 +722,7 @@ fn parseUNC(comptime T: type, path: []const T) WindowsUNC(T) { // For the server, the first path separator after the initial two is always // the terminator of the server name, even if that means the server name is // zero-length. - const server_end = mem.indexOfAnyPos(T, path, 2, any_sep) orelse return .{ + const server_end = mem.findAnyPos(T, path, 2, any_sep) orelse return .{ .server = path[2..path.len], .sep_after_server = false, .share = path[path.len..path.len], |
