| ... | ... | @@ -1357,6 +1357,7 @@ fn windowsCreateProcess(app_name: [*:0]u16, cmd_line: [*:0]u16, envp_ptr: ?[*]u1 |
| 1357 | 1357 | |
| 1358 | 1358 | /// Case-insenstive UTF-16 lookup |
| 1359 | 1359 | fn windowsCreateProcessSupportsExtension(ext: []const u16) bool { |
| 1360 | if (ext.len != 4) return false; |
| 1360 | 1361 | const State = enum { |
| 1361 | 1362 | start, |
| 1362 | 1363 | dot, |
| ... | ... | @@ -1413,6 +1414,11 @@ fn windowsCreateProcessSupportsExtension(ext: []const u16) bool { |
| 1413 | 1414 | return false; |
| 1414 | 1415 | } |
| 1415 | 1416 | |
| 1417 | test "windowsCreateProcessSupportsExtension" { |
| 1418 | try std.testing.expect(windowsCreateProcessSupportsExtension(&[_]u16{ '.', 'e', 'X', 'e' })); |
| 1419 | try std.testing.expect(!windowsCreateProcessSupportsExtension(&[_]u16{ '.', 'e', 'X', 'e', 'c' })); |
| 1420 | } |
| 1421 | |
| 1416 | 1422 | /// Caller must dealloc. |
| 1417 | 1423 | fn windowsCreateCommandLine(allocator: mem.Allocator, argv: []const []const u8) ![:0]u8 { |
| 1418 | 1424 | var buf = std.ArrayList(u8).init(allocator); |