From 1bf7eea29387dc776450a788d0f9c8d80e6b991d Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Sat, 24 Aug 2024 19:31:17 -0300 Subject: [PATCH] Fix issue when filename has [ or ] characters --- src/dotnet-retest/TrxCommand.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotnet-retest/TrxCommand.cs b/src/dotnet-retest/TrxCommand.cs index d1bdaa7..cc74d83 100644 --- a/src/dotnet-retest/TrxCommand.cs +++ b/src/dotnet-retest/TrxCommand.cs @@ -111,7 +111,7 @@ public override int Execute(CommandContext context, TrxSettings settings) // Process from newest files to oldest so that newest result we find (by test id) is the one we keep foreach (var trx in Directory.EnumerateFiles(path, "*.trx", search).OrderByDescending(File.GetLastWriteTime)) { - ctx.Status($"Discovering test results in {Path.GetFileName(trx)}..."); + ctx.Status($"Discovering test results in {Path.GetFileName(trx).EscapeMarkup()}..."); using var file = File.OpenRead(trx); // Clears namespaces var doc = HtmlDocument.Load(file, new HtmlReaderSettings { CaseFolding = Sgml.CaseFolding.None });