From 727b3288d67ffc0642f2ef5b424a3e4cd4b39c00 Mon Sep 17 00:00:00 2001 From: Spiro Trikaliotis Date: Fri, 17 Feb 2023 17:22:55 +0100 Subject: [PATCH] Remove .exe from file output Whenever a tool like ld65 wants to output its name into a log file, it uses the name of command-line parameter 0. However, this parameter also includes the .exe suffix if it is on Windows. This patch removes the .exe suffix, so that the output is clean and consistent across platforms. This fixes #1990. --- src/common/cmdline.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/common/cmdline.c b/src/common/cmdline.c index 4de79a419..6b24a75fb 100644 --- a/src/common/cmdline.c +++ b/src/common/cmdline.c @@ -181,6 +181,17 @@ void InitCmdLine (int* aArgCount, char*** aArgVec, const char* aProgName) /* Use the default */ ProgName = aProgName; } + else { + /* remove .exe extension, if there is any + ** + ** Note: This creates a new string that is + ** never free()d. + ** As this is exactly only string, and it + ** lives for the whole lifetime of the tool, + ** this is not an issue. + */ + ProgName = MakeFilename (ProgName, ""); + } } /* Make a CmdLine struct */