From ddf89f926fa8c143641aeee75efce26692888f07 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Thu, 9 Apr 2026 17:33:41 -0700 Subject: [PATCH] file path seperators --- src/commands/analysis.zig | 2 +- src/tui/analysis_tab.zig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/analysis.zig b/src/commands/analysis.zig index ad89c22..46a8e3e 100644 --- a/src/commands/analysis.zig +++ b/src/commands/analysis.zig @@ -48,7 +48,7 @@ pub fn run(allocator: std.mem.Allocator, svc: *zfin.DataService, file_path: []co defer pf_data.deinit(allocator); // Load classification metadata - const dir_end = if (std.mem.lastIndexOfScalar(u8, file_path, '/')) |idx| idx + 1 else 0; + const dir_end = if (std.mem.lastIndexOfScalar(u8, file_path, std.fs.path.sep)) |idx| idx + 1 else 0; const meta_path = std.fmt.allocPrint(allocator, "{s}metadata.srf", .{file_path[0..dir_end]}) catch return; defer allocator.free(meta_path); diff --git a/src/tui/analysis_tab.zig b/src/tui/analysis_tab.zig index ee510d3..e4dce32 100644 --- a/src/tui/analysis_tab.zig +++ b/src/tui/analysis_tab.zig @@ -22,7 +22,7 @@ pub fn loadData(app: *App) void { // Look for metadata.srf next to the portfolio file if (app.portfolio_path) |ppath| { // Derive metadata path: same directory as portfolio, named "metadata.srf" - const dir_end = if (std.mem.lastIndexOfScalar(u8, ppath, '/')) |idx| idx + 1 else 0; + const dir_end = if (std.mem.lastIndexOfScalar(u8, ppath, std.fs.path.sep)) |idx| idx + 1 else 0; const meta_path = std.fmt.allocPrint(app.allocator, "{s}metadata.srf", .{ppath[0..dir_end]}) catch return; defer app.allocator.free(meta_path); @@ -42,7 +42,7 @@ pub fn loadData(app: *App) void { // Load account tax type metadata file (optional) if (app.account_map == null) { if (app.portfolio_path) |ppath| { - const dir_end = if (std.mem.lastIndexOfScalar(u8, ppath, '/')) |idx| idx + 1 else 0; + const dir_end = if (std.mem.lastIndexOfScalar(u8, ppath, std.fs.path.sep)) |idx| idx + 1 else 0; const acct_path = std.fmt.allocPrint(app.allocator, "{s}accounts.srf", .{ppath[0..dir_end]}) catch { loadDataFinish(app, pf, summary); return;