From e90409b39efc423795b8a482d57b41cf481f3a58 Mon Sep 17 00:00:00 2001 From: Zoltanar Date: Thu, 2 Dec 2021 16:34:49 +0000 Subject: [PATCH] Handle folder arguments with trailing slash. --- AGF2BMP2AGF/RunParameters.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGF2BMP2AGF/RunParameters.cs b/AGF2BMP2AGF/RunParameters.cs index d290637..8068b4b 100644 --- a/AGF2BMP2AGF/RunParameters.cs +++ b/AGF2BMP2AGF/RunParameters.cs @@ -220,7 +220,7 @@ public ConvertFileData[] GetFiles() private static string ReplacePath(string inputFile, string inputDirectory, string outputDirectory, string outputExt, out string partialInputPath, out string partialOutputPath) { - partialInputPath = inputFile.Substring(inputDirectory.Length + 1); + partialInputPath = Path.GetFileName(inputFile); partialOutputPath = ReplaceExtension(partialInputPath, outputExt); var outputFilePath = Path.Combine(outputDirectory ?? inputDirectory, partialOutputPath); return outputFilePath;