about summary refs log tree commit diff
path: root/src/misc.zig
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2025-03-11 17:57:57 +0900
committerNguyễn Gia Phong <cnx@loang.net>2025-03-11 17:57:57 +0900
commitc5ad891da3d5cee9958a02d660db99a41fec111b (patch)
treea05a27125c1fa1acde723b4234dabf89997e4ead /src/misc.zig
parent30f666f3ada479974353cdd7f3be9cdcec497fa1 (diff)
downloadblackshades-main.tar.gz
Port to Zig 0.14 HEAD main
Awaiting upstream libraries to support Zig 0.14 to purge the submodules:
* ini: https://github.com/ziglibs/ini/pull/14#issuecomment-2712560632
* qoi: https://github.com/ikskuh/zig-qoi/pull/14
Diffstat (limited to 'src/misc.zig')
-rw-r--r--src/misc.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/misc.zig b/src/misc.zig
index 46237cb..3bed694 100644
--- a/src/misc.zig
+++ b/src/misc.zig
@@ -1,6 +1,6 @@
 // Miscellaneous functions
 // Copyright (C) 2002  David Rosen
-// Copyright (C) 2021-2023  Nguyễn Gia Phong
+// Copyright (C) 2021-2023, 2025  Nguyễn Gia Phong
 //
 // This file is part of Black Shades.
 //
@@ -193,7 +193,7 @@ pub fn loadScores(base_dir: []const u8) !Scores {
     const path = "blackshades" ++ [_]u8{ sep } ++ "scores.ini";
     const input = dir.openFile(path, .{}) catch return scores;
     defer input.close();
-    var parser = ini.parse(allocator, input.reader());
+    var parser = ini.parse(allocator, input.reader(), "#;");
     defer parser.deinit();
 
     while (try parser.next()) |record|
@@ -241,7 +241,7 @@ pub fn saveScores(base_dir: []const u8, current: Scores) !void {
         previous.completed or current.completed,
     });
     defer allocator.free(data);
-    try dir.writeFile("scores.ini", data);
+    try dir.writeFile(.{ .sub_path = "scores.ini", .data = data });
 }
 
 const Text = struct {