summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2015-01-10 13:09:56 (GMT)
committeralbert-github <albert.tests@gmail.com>2015-01-10 13:09:56 (GMT)
commited178335e8c123b58c4fee24766bceae0fc80aa2 (patch)
tree1b3be1df4701b574ebff3d143e2019133b7be7db /src
parentcd8a78e657556aaa2f3a5fa2120d3181523985ba (diff)
downloadDoxygen-ed178335e8c123b58c4fee24766bceae0fc80aa2.zip
Doxygen-ed178335e8c123b58c4fee24766bceae0fc80aa2.tar.gz
Doxygen-ed178335e8c123b58c4fee24766bceae0fc80aa2.tar.bz2
Enable relative paths referenced source files
This is a regression on pull request 210: Create an easy possibility to take a snippet from the current file. In case the source file, as referenced through 'this' in the snippet command, is in the current directory or in a subdirectory pull request worked fine, but as soon as the source file is in a directory referenced through ../... the parser returns an absolute path name instead of a relative path and file is not found, resulting in a warning plus empty snippet part. We now check whether or not is an absolute file name in which case it is checked if the file is found or not and further handled.
Diffstat (limited to 'src')
-rw-r--r--src/docparser.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 5208bbe..c8e6bf6 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -1743,6 +1743,15 @@ static int internalValidatingParseDoc(DocNode *parent,QList<DocNode> &children,
static void readTextFileByName(const QCString &file,QCString &text)
{
+ if (portable_isAbsolutePath(file.data()))
+ {
+ QFileInfo fi(file);
+ if (fi.exists())
+ {
+ text = fileToString(file,Config_getBool("FILTER_SOURCE_FILES"));
+ return;
+ }
+ }
QStrList &examplePathList = Config_getList("EXAMPLE_PATH");
char *s=examplePathList.first();
while (s)