From cd15a69869ca8f6f4d07635d569cfbb1f2ff4d33 Mon Sep 17 00:00:00 2001 From: cremet Date: Tue, 9 Dec 2003 15:21:23 +0000 Subject: - Fixed the bug that occured when a page refers... - Fixed the bug that occured when a page refers to itself. It came from the optimization in the computation of the shortest from a page to another. --- sources/scala/tools/scaladoc/Page.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'sources') diff --git a/sources/scala/tools/scaladoc/Page.java b/sources/scala/tools/scaladoc/Page.java index 5167fe9d90..993d62ae95 100644 --- a/sources/scala/tools/scaladoc/Page.java +++ b/sources/scala/tools/scaladoc/Page.java @@ -124,10 +124,14 @@ class Page extends HTMLPrinter { * f1 and f2 should be of the form (A/...) */ static private File asSeenFrom(File f1, File f2) { - File lcp = longestCommonPrefix(f1, f2); - File relf1 = subtractPrefix(lcp, f1); - File relf2 = subtractPrefix(lcp, f2); - return new File(pathToRoot(relf2), relf1.getPath()); + if (f1.equals(f2)) + return new File(f1.getName()); + else { + File lcp = longestCommonPrefix(f1, f2); + File relf1 = subtractPrefix(lcp, f1); + File relf2 = subtractPrefix(lcp, f2); + return new File(pathToRoot(relf2), relf1.getPath()); + } } // where /** p and q should be of the form (A/...) */ -- cgit v1.2.3