From a1fde6caada414e2a1eacbe117502d6a67f87d90 Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Tue, 20 Jan 2026 22:14:58 +0000 Subject: [PATCH] refactor(repl): use bun.path.join for history path construction Replace std.fs.path.join with bun.path.join for cross-platform path construction as suggested in code review. The bun.path helper provides consistent path handling across platforms. Co-Authored-By: Claude Opus 4.5 --- src/cli/repl_command.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cli/repl_command.zig b/src/cli/repl_command.zig index f1b5c68be1..8946b5fa6d 100644 --- a/src/cli/repl_command.zig +++ b/src/cli/repl_command.zig @@ -1411,8 +1411,11 @@ pub const History = struct { // Try to get home directory from environment const home = bun.getenvZ("HOME") orelse bun.getenvZ("USERPROFILE") orelse return null; - // Build path: $HOME/.bun_repl_history using proper path joining for cross-platform support - const path = std.fs.path.join(self.allocator, &.{ home, HISTORY_FILE_NAME }) catch return null; + // Build path: $HOME/.bun_repl_history using Bun's path helper for cross-platform support + // bun.path.join returns a slice into a thread-local buffer, so we need to dupe it + const parts = [_][]const u8{ home, HISTORY_FILE_NAME }; + const joined = bun.path.join(&parts, .auto); + const path = self.allocator.dupe(u8, joined) catch return null; return path; }