Skip to content

Commit

Permalink
issue #10473 doxygen hangs forever after "Building directory list..."
Browse files Browse the repository at this point in the history
  • Loading branch information
doxygen committed Dec 15, 2023
1 parent 9bc672a commit 7fc4bce
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
13 changes: 3 additions & 10 deletions src/dirdef.cpp
Expand Up @@ -32,7 +32,6 @@
#include "filedef.h"
#include "trace.h"


//----------------------------------------------------------------------

class DirDefImpl : public DefinitionMixin<DirDef>
Expand Down Expand Up @@ -865,13 +864,7 @@ DirDef *DirDefImpl::mergeDirectoryInTree(const QCString &path)
QCString part=path.left(i+1);
if (!matchPath(part,Config_getList(STRIP_FROM_PATH)) && (part!="/" && part!="//" && part!="//?/"))
{
#if defined(_WIN32)
if (part.startsWith("//?/")) // strip leading "\\?\" part from path
{
part=part.mid(4);
}
#endif
dir=createNewDir(part);
dir=createNewDir(removeLongPathMarker(part));
}
p=i+1;
}
Expand Down Expand Up @@ -993,7 +986,7 @@ static void computeCommonDirPrefix()
if (!Doxygen::dirLinkedMap->empty()) // we have at least one dir
{
// start will full path of first dir
path=(*it)->name();
path=removeLongPathMarker((*it)->name());
int i=path.findRev('/',path.length()-2);
path=path.left(i+1);
bool done=FALSE;
Expand All @@ -1009,7 +1002,7 @@ static void computeCommonDirPrefix()
size_t count=0;
for (const auto &dir : *Doxygen::dirLinkedMap)
{
QCString dirName = dir->name();
QCString dirName = removeLongPathMarker(dir->name());
//printf("dirName='%s' (l=%d) path='%s' (l=%d)\n",qPrint(dirName),dirName.length(),qPrint(path),path.length());
if (dirName.length()>path.length())
{
Expand Down
1 change: 0 additions & 1 deletion src/doxygen.cpp
Expand Up @@ -2312,7 +2312,6 @@ static MemberDef *addVariableToClass(
cd->insertMember(md.get());
mmd->setRefItems(root->sli);

//TODO: insert FileDef instead of filename strings.
cd->insertUsedFile(root->fileDef());
root->markAsProcessed();

Expand Down
5 changes: 3 additions & 2 deletions src/filedef.cpp
Expand Up @@ -276,9 +276,10 @@ FileDefImpl::FileDefImpl(const QCString &p,const QCString &nm,
const QCString &lref,const QCString &dn)
: DefinitionMixin(QCString(p)+nm,1,1,nm,0,0,!p.isEmpty())
{
m_path=p;
m_filePath=m_path+nm;
m_path=removeLongPathMarker(p);
m_filePath=p+nm;
m_fileName=nm;

setReference(lref);
setDiskNameLocal(!dn.isEmpty() ? dn : nm);
m_isSource = guessSection(nm).isSource();
Expand Down
16 changes: 14 additions & 2 deletions src/util.cpp
Expand Up @@ -292,10 +292,22 @@ QCString generateMarker(int id)
return result;
}

static QCString stripFromPath(const QCString &path,const StringVector &l)
QCString removeLongPathMarker(QCString path)
{
#if defined(_WIN32)
if (path.startsWith("//?/")) // strip leading "\\?\" part from path
{
path=path.mid(4);
}
#endif
return path;
}

static QCString stripFromPath(const QCString &p,const StringVector &l)
{
// look at all the strings in the list and strip the longest match
QCString potential;
QCString path=removeLongPathMarker(p);
unsigned int length = 0;
for (const auto &s : l)
{
Expand Down Expand Up @@ -3222,7 +3234,7 @@ FileDef *findFileDef(const FileNameLinkedMap *fnMap,const QCString &n,bool &ambi
slashPos=std::max(name.findRev('/'),name.findRev('\\'));
if (slashPos!=-1)
{
path=name.left(slashPos+1);
path=removeLongPathMarker(name.left(slashPos+1));
name=name.right(name.length()-slashPos-1);
}
if (name.isEmpty()) return 0;
Expand Down
1 change: 1 addition & 0 deletions src/util.h
Expand Up @@ -362,6 +362,7 @@ QCString determineAbsoluteIncludeName(const QCString &curFile,const QCString &in
void createSubDirs(const Dir &d);
void clearSubDirs(const Dir &d);

QCString removeLongPathMarker(QCString path);
QCString stripPath(const QCString &s);

bool containsWord(const QCString &s,const char *word);
Expand Down

0 comments on commit 7fc4bce

Please sign in to comment.