From d036af77ae382906260d7445d1d09afda616b89b Mon Sep 17 00:00:00 2001 From: dkeven Date: Thu, 19 Mar 2026 20:46:56 +0800 Subject: [PATCH] Fix incorrect condition in initramfs_tool_helper() path argument handling --- initramfs.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/initramfs.c b/initramfs.c index f6035da..c6024fd 100644 --- a/initramfs.c +++ b/initramfs.c @@ -364,15 +364,16 @@ static int initramfs_tool_helper(Options *op, int tool, const char *kernel, } /* Build initramfs file path specific command line arguments */ - if (path && initramfs_tools[tool].path_specific_args) { - if (!initramfs_tools[tool].path_specific_args) { + if (path) { + if (initramfs_tools[tool].path_specific_args) { + path_args = nvstrcat(initramfs_tools[tool].path_specific_args, " ", + path, NULL); + } else { ui_log(op, "%s does not take a path argument.", tool_path); goto done; } - path_args = nvstrcat(initramfs_tools[tool].path_specific_args, " ", - path, NULL); } else { - if (initramfs_tools[tool].requires_path || !path) { + if (initramfs_tools[tool].requires_path) { ui_log(op, "%s requires a file path argument, but none was given.", tool_path); goto done;