Skip to content

Commit 05f975e

Browse files
committed
Merge branch 'fix/coberturaPath' of https://github.com/jeremybeier/ReportGenerator into develop
2 parents f801790 + a88324a commit 05f975e

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/Readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ CHANGELOG
6666
4.8.8.0
6767

6868
* Fix: Updated Angular Components (dropped support for IE)
69+
* Fix: #418: Cobertura: Clean up directory separators before path combine
6970

7071
4.8.7.0
7172

src/ReportGenerator.Core/Parser/Preprocessing/CoberturaReportPreprocessor.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,15 @@ internal void Execute(XContainer report)
7171
continue;
7272
}
7373

74-
string path = Path.Combine(sources[0], fileNameAttribute.Value)
74+
string sourcePath = sources[0]
7575
.Replace('\\', Path.DirectorySeparatorChar)
7676
.Replace('/', Path.DirectorySeparatorChar);
77+
78+
string fileName = fileNameAttribute.Value
79+
.Replace('\\', Path.DirectorySeparatorChar)
80+
.Replace('/', Path.DirectorySeparatorChar);
81+
82+
string path = Path.Combine(sourcePath, fileName);
7783
fileNameAttribute.Value = path;
7884
}
7985
}
@@ -90,10 +96,16 @@ internal void Execute(XContainer report)
9096

9197
foreach (var source in sources)
9298
{
93-
string path = Path.Combine(source, fileNameAttribute.Value)
99+
string sourcePath = source
94100
.Replace('\\', Path.DirectorySeparatorChar)
95101
.Replace('/', Path.DirectorySeparatorChar);
96102

103+
string fileName = fileNameAttribute.Value
104+
.Replace('\\', Path.DirectorySeparatorChar)
105+
.Replace('/', Path.DirectorySeparatorChar);
106+
107+
string path = Path.Combine(sourcePath, fileName);
108+
97109
if (File.Exists(path))
98110
{
99111
fileNameAttribute.Value = path;

0 commit comments

Comments
 (0)