chiark / gitweb /
doxygen: don't be so strict about directory parents.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 29 Jan 2018 22:23:35 +0000 (23:23 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 29 Jan 2018 22:54:47 +0000 (23:54 +0100)
There can be quite a mess.

doxygen/dox2html5.py

index b7d2a829bbf69d1a474336bedf90cb5576676eb1..045c5a86bfd5d49dd4a93184d5e8c004877a223d 100755 (executable)
@@ -1258,8 +1258,11 @@ def postprocess_state(state: State):
         # Strip parent dir from dir name
         elif compound.kind == 'dir':
             prefix = state.compounds[compound.parent].name + '/'
-            assert compound.name.startswith(prefix)
-            compound.leaf_name = compound.name[len(prefix):]
+            if compound.name.startswith(prefix):
+                compound.leaf_name = compound.name[len(prefix):]
+            else: # pragma: no cover
+                logging.warning("{}: potential issue: directory {} parent is not a prefix: {}".format(state.current, compound.name, prefix))
+                compound.leaf_name = compound.name
 
         # Other compounds are not in any index pages or breadcrumb, so leaf
         # name not needed