| ... | @@ -253,27 +253,7 @@ pub fn windowsParsePath(path: []const u8) WindowsPath { | ... | @@ -253,27 +253,7 @@ pub fn windowsParsePath(path: []const u8) WindowsPath { |
| 253 | return relative_path; | 253 | return relative_path; |
| 254 | } | 254 | } |
| 255 | | 255 | |
| 256 | // TODO when I combined these together with `inline for` the compiler crashed | 256 | inline for ("/\\") |this_sep| { |
| 257 | { | | |
| 258 | const this_sep = '/'; | | |
| 259 | const two_sep = [_]u8{ this_sep, this_sep }; | | |
| 260 | if (mem.startsWith(u8, path, two_sep)) { | | |
| 261 | if (path[2] == this_sep) { | | |
| 262 | return relative_path; | | |
| 263 | } | | |
| 264 | | | |
| 265 | var it = mem.tokenize(path, [_]u8{this_sep}); | | |
| 266 | _ = (it.next() orelse return relative_path); | | |
| 267 | _ = (it.next() orelse return relative_path); | | |
| 268 | return WindowsPath{ | | |
| 269 | .is_abs = isAbsoluteWindows(path), | | |
| 270 | .kind = WindowsPath.Kind.NetworkShare, | | |
| 271 | .disk_designator = path[0..it.index], | | |
| 272 | }; | | |
| 273 | } | | |
| 274 | } | | |
| 275 | { | | |
| 276 | const this_sep = '\\'; | | |
| 277 | const two_sep = [_]u8{ this_sep, this_sep }; | 257 | const two_sep = [_]u8{ this_sep, this_sep }; |
| 278 | if (mem.startsWith(u8, path, two_sep)) { | 258 | if (mem.startsWith(u8, path, two_sep)) { |
| 279 | if (path[2] == this_sep) { | 259 | if (path[2] == this_sep) { |