glfw: handle windows \r\n in Apple SDK prompt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
161e07575a
commit
bfe841880d
1 changed files with 3 additions and 1 deletions
|
@ -261,7 +261,9 @@ fn confirmAppleSDKAgreement(allocator: *std.mem.Allocator) !bool {
|
||||||
try stdout.print("Do you agree to those terms? [Y/n] ", .{});
|
try stdout.print("Do you agree to those terms? [Y/n] ", .{});
|
||||||
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", .{});
|
||||||
return std.mem.eql(u8, user_input, "y") or std.mem.eql(u8, user_input, "Y") or std.mem.eql(u8, user_input, "yes") or std.mem.eql(u8, user_input, "");
|
var in = user_input;
|
||||||
|
if (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, "");
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue