Skip to content

Commit

Permalink
Enable relative paths referenced source files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
albert-github committed Jan 10, 2015
1 parent cd8a78e commit ed17833
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/docparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ed17833

Please sign in to comment.