mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
popDirectory() make sure the stack is not empty
This commit is contained in:
parent
e2c5db0b47
commit
04682bb2bc
1 changed files with 6 additions and 6 deletions
|
@ -90,7 +90,7 @@ public class ErrorParserManager extends OutputStream {
|
||||||
}
|
}
|
||||||
// Fallback to the Project Location
|
// Fallback to the Project Location
|
||||||
// FIXME: if the build did not start in the Project ?
|
// FIXME: if the build did not start in the Project ?
|
||||||
return fProject.getLocation();
|
return fBaseDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pushDirectory(IPath dir) {
|
public void pushDirectory(IPath dir) {
|
||||||
|
@ -99,8 +99,7 @@ public class ErrorParserManager extends OutputStream {
|
||||||
if (fBaseDirectory.isPrefixOf(dir)) {
|
if (fBaseDirectory.isPrefixOf(dir)) {
|
||||||
int segments = fBaseDirectory.matchingFirstSegments(dir);
|
int segments = fBaseDirectory.matchingFirstSegments(dir);
|
||||||
pwd = dir.removeFirstSegments(segments);
|
pwd = dir.removeFirstSegments(segments);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
pwd = dir;
|
pwd = dir;
|
||||||
}
|
}
|
||||||
fDirectoryStack.addElement(pwd);
|
fDirectoryStack.addElement(pwd);
|
||||||
|
@ -109,11 +108,12 @@ public class ErrorParserManager extends OutputStream {
|
||||||
|
|
||||||
public IPath popDirectory() {
|
public IPath popDirectory() {
|
||||||
int i = fDirectoryStack.size();
|
int i = fDirectoryStack.size();
|
||||||
IPath dir = (IPath) fDirectoryStack.lastElement();
|
if (i != 0) {
|
||||||
if (i != 0) {
|
IPath dir = (IPath) fDirectoryStack.lastElement();
|
||||||
fDirectoryStack.removeElementAt(i - 1);
|
fDirectoryStack.removeElementAt(i - 1);
|
||||||
|
return dir;
|
||||||
}
|
}
|
||||||
return dir;
|
return new Path("");
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDirectoryLevel() {
|
public int getDirectoryLevel() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue