@@ -358,7 +358,7 @@ pub fn windowsParsePath(path: []const u8) WindowsPath {
358358 return relative_path ;
359359 }
360360
361- var it = mem .tokenize (u8 , path , &[ _ ] u8 { this_sep } );
361+ var it = mem .tokenizeScalar (u8 , path , this_sep );
362362 _ = (it .next () orelse return relative_path );
363363 _ = (it .next () orelse return relative_path );
364364 return WindowsPath {
@@ -420,8 +420,8 @@ fn networkShareServersEql(ns1: []const u8, ns2: []const u8) bool {
420420 const sep1 = ns1 [0 ];
421421 const sep2 = ns2 [0 ];
422422
423- var it1 = mem .tokenize (u8 , ns1 , &[ _ ] u8 { sep1 } );
424- var it2 = mem .tokenize (u8 , ns2 , &[ _ ] u8 { sep2 } );
423+ var it1 = mem .tokenizeScalar (u8 , ns1 , sep1 );
424+ var it2 = mem .tokenizeScalar (u8 , ns2 , sep2 );
425425
426426 // TODO ASCII is wrong, we actually need full unicode support to compare paths.
427427 return ascii .eqlIgnoreCase (it1 .next ().? , it2 .next ().? );
@@ -441,8 +441,8 @@ fn compareDiskDesignators(kind: WindowsPath.Kind, p1: []const u8, p2: []const u8
441441 const sep1 = p1 [0 ];
442442 const sep2 = p2 [0 ];
443443
444- var it1 = mem .tokenize (u8 , p1 , &[ _ ] u8 { sep1 } );
445- var it2 = mem .tokenize (u8 , p2 , &[ _ ] u8 { sep2 } );
444+ var it1 = mem .tokenizeScalar (u8 , p1 , sep1 );
445+ var it2 = mem .tokenizeScalar (u8 , p2 , sep2 );
446446
447447 // TODO ASCII is wrong, we actually need full unicode support to compare paths.
448448 return ascii .eqlIgnoreCase (it1 .next ().? , it2 .next ().? ) and ascii .eqlIgnoreCase (it1 .next ().? , it2 .next ().? );
@@ -535,7 +535,7 @@ pub fn resolveWindows(allocator: Allocator, paths: []const []const u8) ![]u8 {
535535 break :l disk_designator .len ;
536536 },
537537 .NetworkShare = > {
538- var it = mem .tokenize (u8 , paths [first_index ], "/\\ " );
538+ var it = mem .tokenizeAny (u8 , paths [first_index ], "/\\ " );
539539 const server_name = it .next ().? ;
540540 const other_name = it .next ().? ;
541541
@@ -570,7 +570,7 @@ pub fn resolveWindows(allocator: Allocator, paths: []const []const u8) ![]u8 {
570570 if (! correct_disk_designator ) {
571571 continue ;
572572 }
573- var it = mem .tokenize (u8 , p [parsed .disk_designator .len .. ], "/\\ " );
573+ var it = mem .tokenizeAny (u8 , p [parsed .disk_designator .len .. ], "/\\ " );
574574 while (it .next ()) | component | {
575575 if (mem .eql (u8 , component , "." )) {
576576 continue ;
@@ -657,7 +657,7 @@ pub fn resolvePosix(allocator: Allocator, paths: []const []const u8) Allocator.E
657657 negative_count = 0 ;
658658 result .clearRetainingCapacity ();
659659 }
660- var it = mem .tokenize (u8 , p , "/" );
660+ var it = mem .tokenizeScalar (u8 , p , '/' );
661661 while (it .next ()) | component | {
662662 if (mem .eql (u8 , component , "." )) {
663663 continue ;
@@ -1078,8 +1078,8 @@ pub fn relativeWindows(allocator: Allocator, from: []const u8, to: []const u8) !
10781078 return resolved_to ;
10791079 }
10801080
1081- var from_it = mem .tokenize (u8 , resolved_from , "/\\ " );
1082- var to_it = mem .tokenize (u8 , resolved_to , "/\\ " );
1081+ var from_it = mem .tokenizeAny (u8 , resolved_from , "/\\ " );
1082+ var to_it = mem .tokenizeAny (u8 , resolved_to , "/\\ " );
10831083 while (true ) {
10841084 const from_component = from_it .next () orelse return allocator .dupe (u8 , to_it .rest ());
10851085 const to_rest = to_it .rest ();
@@ -1102,7 +1102,7 @@ pub fn relativeWindows(allocator: Allocator, from: []const u8, to: []const u8) !
11021102 result_index += 3 ;
11031103 }
11041104
1105- var rest_it = mem .tokenize (u8 , to_rest , "/\\ " );
1105+ var rest_it = mem .tokenizeAny (u8 , to_rest , "/\\ " );
11061106 while (rest_it .next ()) | to_component | {
11071107 result [result_index ] = '\\ ' ;
11081108 result_index += 1 ;
@@ -1124,8 +1124,8 @@ pub fn relativePosix(allocator: Allocator, from: []const u8, to: []const u8) ![]
11241124 const resolved_to = try resolvePosix (allocator , &[_ ][]const u8 { cwd , to });
11251125 defer allocator .free (resolved_to );
11261126
1127- var from_it = mem .tokenize (u8 , resolved_from , "/" );
1128- var to_it = mem .tokenize (u8 , resolved_to , "/" );
1127+ var from_it = mem .tokenizeScalar (u8 , resolved_from , '/' );
1128+ var to_it = mem .tokenizeScalar (u8 , resolved_to , '/' );
11291129 while (true ) {
11301130 const from_component = from_it .next () orelse return allocator .dupe (u8 , to_it .rest ());
11311131 const to_rest = to_it .rest ();
0 commit comments