summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcremet <cremet@epfl.ch>2003-12-09 15:21:23 +0000
committercremet <cremet@epfl.ch>2003-12-09 15:21:23 +0000
commitcd15a69869ca8f6f4d07635d569cfbb1f2ff4d33 (patch)
treef518757f90e4eb63d29b59454b4ee39c6d915f4e
parentfa15a3d86678031567fd8d1cce2e73628f4d24ac (diff)
downloadscala-cd15a69869ca8f6f4d07635d569cfbb1f2ff4d33.tar.gz
scala-cd15a69869ca8f6f4d07635d569cfbb1f2ff4d33.tar.bz2
scala-cd15a69869ca8f6f4d07635d569cfbb1f2ff4d33.zip
- 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.
-rw-r--r--sources/scala/tools/scaladoc/Page.java12
1 files changed, 8 insertions, 4 deletions
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/...) */