ignore directory .zig-cache

The pre-release version of zig 0.13.0 was using 'zig-cache', but the
release version uses '.zig-cache'.
This commit is contained in:
2024-09-09 14:30:46 +02:00
parent 39bcda689d
commit d0f5860a44
2 changed files with 3 additions and 3 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.zig-cache
zig-cache zig-cache
zig-out zig-out

View File

@@ -244,7 +244,7 @@ fn configLocation(allocator: Allocator) ![]const u8 {
} }
/// Reads the config file into a list of OtpAuthUrl. /// Reads the config file into a list of OtpAuthUrl.
/// The caller is responsible to free the memory. /// The caller should use an arena allocator and free the memory eventually.
fn read_config(allocator: Allocator, config_location: []const u8) !ArrayList(OtpAuthUrl) { fn read_config(allocator: Allocator, config_location: []const u8) !ArrayList(OtpAuthUrl) {
const file = try std.fs.cwd().openFile(config_location, .{}); const file = try std.fs.cwd().openFile(config_location, .{});
defer file.close(); defer file.close();
@@ -256,7 +256,6 @@ fn read_config(allocator: Allocator, config_location: []const u8) !ArrayList(Otp
var line_no: usize = 1; var line_no: usize = 1;
while (try in_stream.readUntilDelimiterOrEofAlloc(allocator, '\n', 1024 * 1024)) |line| { while (try in_stream.readUntilDelimiterOrEofAlloc(allocator, '\n', 1024 * 1024)) |line| {
//defer allocator.free(line);
if (line.len > 0 and std.mem.trim(u8, line, " \r").len > 0) { if (line.len > 0 and std.mem.trim(u8, line, " \r").len > 0) {
const authenticatorResult = parseOtpAuthUrl(allocator, line); const authenticatorResult = parseOtpAuthUrl(allocator, line);
if (authenticatorResult) |authenticator| { if (authenticatorResult) |authenticator| {
@@ -264,7 +263,7 @@ fn read_config(allocator: Allocator, config_location: []const u8) !ArrayList(Otp
} else |err| { } else |err| {
switch (err) { switch (err) {
error.InvalidOtpAuthUrl => { error.InvalidOtpAuthUrl => {
try std.io.getStdErr().writer().print("invalid otpauth url in line {d}\n", .{line_no}); try std.io.getStdErr().writer().print("invalid otpauth url in line {d} in {s}\n", .{ line_no, config_location });
}, },
else => { else => {
return err; return err;