Skip to content

Commit 81a4e55

Browse files
authored
Fix EtwProfiler for file paths slightly under 260 chars (#2808)
1 parent 197d8ed commit 81a4e55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BenchmarkDotNet/Helpers/ArtifactFileNameHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal static class ArtifactFileNameHelper
1818

1919
internal static string GetTraceFilePath(DiagnoserActionParameters details, DateTime creationTime, string fileExtension)
2020
{
21-
return GetFilePath(details, null, creationTime, fileExtension, "userheap.etl".Length);
21+
return GetFilePath(details, null, creationTime, fileExtension, "userheap.etl".Length - fileExtension.Length);
2222
}
2323

2424
internal static string GetFilePath(DiagnoserActionParameters details, string? subfolder, DateTime? creationTime, string fileExtension, int reserve)
@@ -27,7 +27,7 @@ internal static string GetFilePath(DiagnoserActionParameters details, string? su
2727

2828
// long paths can be enabled on Windows but it does not mean that everything is going to work fine..
2929
// so we always use 260 as limit on Windows
30-
int limit = OsDetector.IsWindows()
30+
int limit = OsDetector.IsWindows()
3131
? WindowsOldPathLimit - reserve
3232
: CommonSenseLimit;
3333

0 commit comments

Comments
 (0)