From 04682bb2bc1fff0c544e69b3c460fdbe97c79c75 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Fri, 20 Dec 2002 21:13:47 +0000 Subject: [PATCH] popDirectory() make sure the stack is not empty --- .../src/org/eclipse/cdt/core/ErrorParserManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java index 26ba0ab0514..f244399ca85 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java @@ -90,7 +90,7 @@ public class ErrorParserManager extends OutputStream { } // Fallback to the Project Location // FIXME: if the build did not start in the Project ? - return fProject.getLocation(); + return fBaseDirectory; } public void pushDirectory(IPath dir) { @@ -99,8 +99,7 @@ public class ErrorParserManager extends OutputStream { if (fBaseDirectory.isPrefixOf(dir)) { int segments = fBaseDirectory.matchingFirstSegments(dir); pwd = dir.removeFirstSegments(segments); - } - else { + } else { pwd = dir; } fDirectoryStack.addElement(pwd); @@ -109,11 +108,12 @@ public class ErrorParserManager extends OutputStream { public IPath popDirectory() { int i = fDirectoryStack.size(); - IPath dir = (IPath) fDirectoryStack.lastElement(); - if (i != 0) { + if (i != 0) { + IPath dir = (IPath) fDirectoryStack.lastElement(); fDirectoryStack.removeElementAt(i - 1); + return dir; } - return dir; + return new Path(""); } public int getDirectoryLevel() {