summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/doxygen.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 257a031..82c86ce 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -9325,11 +9325,22 @@ static void generateDiskNames()
int first_path_size = static_cast<int>(first.path.size())-1; // -1 to skip trailing slash
int last_path_size = static_cast<int>(last.path.size())-1; // -1 to skip trailing slash
int j=0;
- for (int i=0;i<first_path_size && i<last_path_size;i++)
+ int i=0;
+ for (i=0;i<first_path_size && i<last_path_size;i++)
{
if (first.path[i]=='/') j=i;
if (first.path[i]!=last.path[i]) break;
}
+ if (i==first_path_size && i<last_path_size && last.path[i]=='/')
+ {
+ // case first='some/path' and last='some/path/more' => match is 'some/path'
+ j=first_path_size;
+ }
+ else if (i==last_path_size && i<first_path_size && first.path[i]=='/')
+ {
+ // case first='some/path/more' and last='some/path' => match is 'some/path'
+ j=last_path_size;
+ }
// add non-common part of the path to the name
for (auto &fileEntry : fileEntries)