From 9193cfa6d2769a2a615674e0349afee529289412 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 12 Feb 2024 19:31:58 -0800 Subject: [PATCH] style nit --- src/terminal/kitty/graphics_image.zig | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/terminal/kitty/graphics_image.zig b/src/terminal/kitty/graphics_image.zig index 7bd953ef9..b5c36db80 100644 --- a/src/terminal/kitty/graphics_image.zig +++ b/src/terminal/kitty/graphics_image.zig @@ -76,11 +76,15 @@ pub const LoadingImage = struct { return error.InvalidData; }; - if (builtin.os != .windows and std.mem.indexOfScalar(u8, buf[0..size], 0) == null) { - // std.os.realpath *asserts* that the path does not have internal nulls instead of erroring. - log.warn("failed to get absolute path: BadPathName", .{}); - return error.InvalidData; + if (comptime builtin.os != .windows) { + if (std.mem.indexOfScalar(u8, buf[0..size], 0) == null) { + // std.os.realpath *asserts* that the path does not have + // internal nulls instead of erroring. + log.warn("failed to get absolute path: BadPathName", .{}); + return error.InvalidData; + } } + var abs_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; const path = std.os.realpath(buf[0..size], &abs_buf) catch |err| { log.warn("failed to get absolute path: {}", .{err});