mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-06-10 17:09:59 +00:00
fix zig build error when '.progress.txt' contains newline
This commit is contained in:
@@ -278,7 +278,8 @@ pub fn build(b: *Build) !void {
|
|||||||
return error.UnexpectedEOF;
|
return error.UnexpectedEOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
starting_exercise = try std.fmt.parseInt(u32, contents, 10);
|
const trimmed_contents = std.mem.trim(u8, contents, "\r\n");
|
||||||
|
starting_exercise = try std.fmt.parseInt(u32, trimmed_contents, 10);
|
||||||
} else |err| {
|
} else |err| {
|
||||||
switch (err) {
|
switch (err) {
|
||||||
std.Io.File.OpenError.FileNotFound => {
|
std.Io.File.OpenError.FileNotFound => {
|
||||||
|
|||||||
Reference in New Issue
Block a user