@@ -695,8 +695,6 @@ def walk(head, current=None):
695695
696696def getManualDirectories ():
697697 directories = None
698- pagePath = directoryPath (conf .path )
699-
700698 defaultDocRoot = DEFAULT_DOC_ROOTS .get (Backend .getOs (), DEFAULT_DOC_ROOTS [OS .LINUX ])
701699
702700 if kb .absFilePaths :
@@ -714,18 +712,18 @@ def getManualDirectories():
714712 windowsDriveLetter , absFilePath = absFilePath [:2 ], absFilePath [2 :]
715713 absFilePath = ntToPosixSlashes (posixToNtSlashes (absFilePath ))
716714
717- if any ("/%s/" % _ in absFilePath for _ in GENERIC_DOC_ROOT_DIRECTORY_NAMES ):
718- for _ in GENERIC_DOC_ROOT_DIRECTORY_NAMES :
719- _ = "/%s/" % _
715+ for _ in list (GENERIC_DOC_ROOT_DIRECTORY_NAMES ) + [conf .hostname ]:
716+ _ = "/%s/" % _
720717
721- if _ in absFilePath :
722- directories = "%s%s" % (absFilePath .split (_ )[0 ], _ )
723- break
718+ if _ in absFilePath :
719+ directories = "%s%s" % (absFilePath .split (_ )[0 ], _ )
720+ break
721+
722+ if not directories and conf .path .strip ('/' ) and conf .path in absFilePath :
723+ directories = absFilePath .split (conf .path )[0 ]
724724
725- if pagePath and pagePath in absFilePath :
726- directories = absFilePath .split (pagePath )[0 ]
727- if windowsDriveLetter :
728- directories = "%s/%s" % (windowsDriveLetter , ntToPosixSlashes (directories ))
725+ if directories and windowsDriveLetter :
726+ directories = "%s/%s" % (windowsDriveLetter , ntToPosixSlashes (directories ))
729727
730728 directories = normalizePath (directories )
731729
0 commit comments