summaryrefslogtreecommitdiffstats
path: root/src/code.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2002-04-30 17:51:14 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2002-04-30 17:51:14 (GMT)
commit758291b1be0c43c13088389b0cfbb560efe00c1f (patch)
treea37d75aa0ebe073906cb1a3c2c1506b96409f075 /src/code.l
parent210582f8060fb41f6ad34d8315c9dd27b1bb6834 (diff)
downloadDoxygen-758291b1be0c43c13088389b0cfbb560efe00c1f.zip
Doxygen-758291b1be0c43c13088389b0cfbb560efe00c1f.tar.gz
Doxygen-758291b1be0c43c13088389b0cfbb560efe00c1f.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