From 14c6d767c7c9d50f799dc825ae45833f38e701ea Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 10 Dec 2011 19:37:33 +0000 Subject: [PATCH] codetools: readded check for unitname git-svn-id: trunk@34096 - --- components/codetools/finddeclarationtool.pas | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 501cc7c1e3..cc214dfb0f 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -1896,10 +1896,18 @@ end; function TFindDeclarationTool.FindUnitInAllUsesSections( const AnUnitName: string; out NamePos, InPos: TAtomPosition): boolean; var SectionNode, UsesNode: TCodeTreeNode; + + procedure RaiseInvalidUnitName; + begin + raise Exception.Create('invalid unit name '+AnUnitName); + end; + begin Result:=false; NamePos.StartPos:=-1; InPos.StartPos:=-1; + if not IsDottedIdentifier(AnUnitName) then + RaiseInvalidUnitName; BuildTree(lsrImplementationUsesSectionEnd); SectionNode:=Tree.Root; while (SectionNode<>nil) and (SectionNode.Desc in [ctnProgram, ctnUnit,