summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomasz Śniatowski <tsniatowski@opera.com>2015-12-03 08:01:31 (GMT)
committerTomasz Śniatowski <tsniatowski@opera.com>2015-12-03 08:05:44 (GMT)
commitc6bf96520bcff56d3fd67d4277c05b8db9ac2128 (patch)
treef5a73ad7274adc3e2d3f892faea475f441cea279 /src
parent53ca521c3de1a23d7a1f3766f011c1a21637e94e (diff)
downloadDoxygen-c6bf96520bcff56d3fd67d4277c05b8db9ac2128.zip
Doxygen-c6bf96520bcff56d3fd67d4277c05b8db9ac2128.tar.gz
Doxygen-c6bf96520bcff56d3fd67d4277c05b8db9ac2128.tar.bz2
Fix computeCommonDirPrefix sometimes not finding the correct prefix
The code in some cases would search backwards in a string starting from an offset beyond the string's length. Adjust so that doesn't happen and the code doesn't mistakenly assume there is no common dir prefix. This bug has in some scenarios led to absolute paths being used for dir_(md5).html links, making doxygen output needlessly depend on details of build-time paths.
Diffstat (limited to 'src')
-rw-r--r--src/dirdef.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/dirdef.cpp b/src/dirdef.cpp
index 28c073e..10adcc9 100644
--- a/src/dirdef.cpp
+++ b/src/dirdef.cpp
@@ -836,6 +836,7 @@ static void computeCommonDirPrefix()
else // dir is shorter than path -> take path of dir as new start
{
path=dir->name();
+ l=path.length();
int i=path.findRev('/',l-2);
if (i==-1) // no unique prefix -> stop
{