mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Fix for PR 82052 [ScannerConfig] new Mozilla Standard C++ project has weird Discovery paths with errors.
In ScannerInfoConsoleParserUtility - Absolute include paths are correctly handled in translateRelativePaths(..). - Corrected normalization of paths ending with single dot in normalizePath(..)
This commit is contained in:
parent
e20f39193f
commit
4aad3e762a
1 changed files with 8 additions and 3 deletions
|
@ -333,9 +333,13 @@ public class ScannerInfoConsoleParserUtility implements IScannerInfoConsoleParse
|
||||||
if (!cwd.isAbsolute()) {
|
if (!cwd.isAbsolute()) {
|
||||||
cwd = fProject.getLocation().append(cwd);
|
cwd = fProject.getLocation().append(cwd);
|
||||||
}
|
}
|
||||||
// check if the cwd is the right one
|
|
||||||
// appending fileName to cwd should yield file path
|
IPath filePath = new Path(fileName);
|
||||||
IPath filePath = cwd.append(fileName);
|
if (!filePath.isAbsolute()) {
|
||||||
|
// check if the cwd is the right one
|
||||||
|
// appending fileName to cwd should yield file path
|
||||||
|
filePath = cwd.append(fileName);
|
||||||
|
}
|
||||||
if (!filePath.toString().equalsIgnoreCase(file.getLocation().toString())) {
|
if (!filePath.toString().equalsIgnoreCase(file.getLocation().toString())) {
|
||||||
// must be the cwd is wrong
|
// must be the cwd is wrong
|
||||||
// check if file name starts with ".."
|
// check if file name starts with ".."
|
||||||
|
@ -409,6 +413,7 @@ public class ScannerInfoConsoleParserUtility implements IScannerInfoConsoleParse
|
||||||
int ddot = buf.indexOf("..", ssp);//$NON-NLS-1$
|
int ddot = buf.indexOf("..", ssp);//$NON-NLS-1$
|
||||||
if (sdot < ddot || ddot == -1) {
|
if (sdot < ddot || ddot == -1) {
|
||||||
newBuf.append(buf.substring(scp, sdot));
|
newBuf.append(buf.substring(scp, sdot));
|
||||||
|
scp = sdot;
|
||||||
ssp = sdot + 1;
|
ssp = sdot + 1;
|
||||||
if (ssp < len) {
|
if (ssp < len) {
|
||||||
if (sdot == 0 || buf.charAt(sdot - 1) == '/' || buf.charAt(sdot - 1) == '\\') {
|
if (sdot == 0 || buf.charAt(sdot - 1) == '/' || buf.charAt(sdot - 1) == '\\') {
|
||||||
|
|
Loading…
Add table
Reference in a new issue