summaryrefslogtreecommitdiffstats
path: root/src/code.l
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-04-30 17:51:14 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-04-30 17:51:14 (GMT)
commit62d3c6501af58ceb48ce8e56327d07ad69e79374 (patch)
treea37d75aa0ebe073906cb1a3c2c1506b96409f075 /src/code.l
parentff31b2f109848ea3e08fb17d5821beb7af879193 (diff)
downloadDoxygen-62d3c6501af58ceb48ce8e56327d07ad69e79374.zip
Doxygen-62d3c6501af58ceb48ce8e56327d07ad69e79374.tar.gz
Doxygen-62d3c6501af58ceb48ce8e56327d07ad69e79374.tar.bz2
Release-1.2.15-20020430
Diffstat (limited to 'src/code.l')
-rw-r--r--src/code.l29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/code.l b/src/code.l
index 9d6f285..878cda9 100644
--- a/src/code.l
+++ b/src/code.l
@@ -24,6 +24,7 @@
#include <assert.h>
#include <ctype.h>
#include <qregexp.h>
+#include <qdir.h>
#include "qtbc.h"
#include "scanner.h"
@@ -1044,10 +1045,36 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
<ReadInclude>[^\n\"\>]+/(">"|"\"") {
//FileInfo *f;
bool ambig;
- FileDef *fd;
+ bool found=FALSE;
+ FileDef *fd=0;
if ((fd=findFileDef(Doxygen::inputNameDict,yytext,ambig)) &&
fd->isLinkable())
{
+ if (ambig) // multiple input files match the name
+ {
+ //printf("===== yes %s is ambigious\n",yytext);
+ QCString name = convertToQCString(QDir::cleanDirPath(yytext));
+ if (!name.isEmpty() && g_sourceFileDef)
+ {
+ FileName *fn = Doxygen::inputNameDict->find(name);
+ FileNameIterator fni(*fn);
+ // for each include name
+ for (fni.toFirst();!found && (fd=fni.current());++fni)
+ {
+ // see if this source file actually includes the file
+ found = g_sourceFileDef->isIncluded(fd->absFilePath());
+ //printf(" include file %s found=%d\n",fd->absFilePath().data(),found);
+ }
+ }
+ }
+ else // not ambiguous
+ {
+ found = TRUE;
+ }
+ }
+ if (found)
+ {
+ //printf(" include file %s found=%d\n",fd->absFilePath().data(),found);
g_code->writeCodeLink(fd->getReference(),fd->getOutputFileBase(),0,yytext);
}
else