Skip to content

Commit a13284e

Browse files
committed
Fix findFileDef incorrectly flagging ambiguities
Fix issues when comparing stripped paths due to improper handling of empty stripped paths. Fixes: #6178 Fixes: #11261 Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 parent cbe58f6 commit a13284e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/util.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3474,7 +3474,9 @@ FileDef *findFileDef(const FileNameLinkedMap *fnMap,const QCString &n,bool &ambi
34743474
{
34753475
FileDef *fd = fd_p.get();
34763476
QCString fdStripPath = stripFromIncludePath(fd->getPath());
3477-
if (path.isEmpty() || fdStripPath.right(pathStripped.length())==pathStripped)
3477+
if (path.isEmpty() ||
3478+
(!pathStripped.isEmpty() && fdStripPath.endsWith(pathStripped)) ||
3479+
(pathStripped.isEmpty() && fdStripPath.isEmpty()))
34783480
{
34793481
count++;
34803482
lastMatch=fd;

0 commit comments

Comments
 (0)