langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
changeset 18404 a5aaa0341fec
parent 18402 8035e3fbae01
child 19907 41ae54351dea
child 21026 b35314edf87a
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Fri May 31 10:28:30 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Fri Jun 07 16:12:04 2013 -0700
@@ -314,7 +314,8 @@
                 "    if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + DocletConstants.NL +
                 "        targetPage = \"undefined\";" + DocletConstants.NL +
                 "    function validURL(url) {" + DocletConstants.NL +
-                "        if (!(url.indexOf(\".html\") == url.length - 5))" + DocletConstants.NL +
+                "        var pos = url.indexOf(\".html\");" + DocletConstants.NL +
+                "        if (pos == -1 || pos != url.length - 5)" + DocletConstants.NL +
                 "            return false;" + DocletConstants.NL +
                 "        var allowNumber = false;" + DocletConstants.NL +
                 "        var allowSep = false;" + DocletConstants.NL +