1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +02:00

Bug 525438 - Fix file path comparison in AbstractIndexAstChecker.getLineCommentsForLocation()

Using IPath.toPortableString() was causing a forward slash vs.
backward slash mismtach in the path comparison on Windows.

Change-Id: Ib3eb392065fb473f6b6e70cb1dcddceb34ae7240
This commit is contained in:
Nathan Ridge 2017-10-06 16:11:45 -04:00
parent f5c0094767
commit 9792a72dae

View file

@ -171,8 +171,7 @@ public abstract class AbstractIndexAstChecker extends AbstractCheckerWithProblem
for (IASTComment comm : commentsArray) {
IASTFileLocation fileLocation = comm.getFileLocation();
if (fileLocation.getStartingLineNumber() == loc.getLineNumber()) {
//XXX check on windows portable or os?
String problemFile = loc.getFile().getLocation().toPortableString();
String problemFile = loc.getFile().getLocation().toOSString();
String commentFile = fileLocation.getFileName();
if (problemFile.equals(commentFile)) {
lineComments.add(comm);