From 30f7903424ecbb481ae3e4ef4f7bae710d5f367e Mon Sep 17 00:00:00 2001 From: John Camelon Date: Mon, 28 Jul 2003 15:40:36 +0000 Subject: [PATCH] Fixed Bug 40730 - Parser is not searching the include path for #include"" --- core/org.eclipse.cdt.core/parser/ChangeLog | 3 +++ .../org/eclipse/cdt/internal/core/parser/Scanner.java | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/ChangeLog b/core/org.eclipse.cdt.core/parser/ChangeLog index 2e26739f780..1c449ce066a 100644 --- a/core/org.eclipse.cdt.core/parser/ChangeLog +++ b/core/org.eclipse.cdt.core/parser/ChangeLog @@ -1,3 +1,6 @@ +2003-07-28 John Camelon + Fixed Bug 40730 : Parser is not searching the include path for #include"" + 2003-07-28 Victor Mozgin Fixed PR 39537 : Parser fails if template parameters contain '>' or '<' characters. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java index b1f4e5f9ef1..c2999cec0c7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java @@ -322,10 +322,15 @@ public class Scanner implements IScanner { inclusionReader = new FileReader(includeFile); } catch (FileNotFoundException fnf) { - if (throwExceptionOnInclusionNotFound) - throw new ScannerException("Cannot find inclusion " + fileName); + // the spec says that if finding in the local directory fails, search the include paths + handleInclusion( fileName, true, nameOffset, beginOffset, endOffset ); } } + else + { + // the spec says that if finding in the local directory fails, search the include paths + handleInclusion( fileName, true, nameOffset, beginOffset, endOffset ); + } } if (throwExceptionOnInclusionNotFound && inclusionReader == null )