glfw: fix panic when pressing enter on Apple SDK license prompt (fixes #22)

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2021-09-13 20:43:19 -07:00 committed by Stephen Gutekanst
parent 7ca9b85d43
commit c3bdb99a14
3 changed files with 2720 additions and 1 deletions

View file

@ -320,7 +320,7 @@ fn confirmAppleSDKAgreement(allocator: *std.mem.Allocator) !bool {
if (try stdin.readUntilDelimiterOrEof(buf[0..], '\n')) |user_input| { if (try stdin.readUntilDelimiterOrEof(buf[0..], '\n')) |user_input| {
try stdout.print("\n", .{}); try stdout.print("\n", .{});
var in = user_input; var in = user_input;
if (in[in.len - 1] == '\r') in = in[0 .. in.len - 1]; if (in.len > 0 and in[in.len - 1] == '\r') in = in[0 .. in.len - 1];
return std.mem.eql(u8, in, "y") or std.mem.eql(u8, in, "Y") or std.mem.eql(u8, in, "yes") or std.mem.eql(u8, in, ""); return std.mem.eql(u8, in, "y") or std.mem.eql(u8, in, "Y") or std.mem.eql(u8, in, "yes") or std.mem.eql(u8, in, "");
} else { } else {
return false; return false;

BIN
glfw/libglfw3.a Normal file

Binary file not shown.

2719
glfw/src/TODO Normal file

File diff suppressed because it is too large Load diff