From d4fa29338b553c329964a6566bf5d6cd404dc237 Mon Sep 17 00:00:00 2001 From: "mozilla.mano%sent.com" Date: Thu, 7 Jul 2005 19:30:09 +0000 Subject: [PATCH] Bug 296275 - forward button history throws error. patch from Gavin Sharp , r=mconnor, a=asa. git-svn-id: svn://10.0.0.236/trunk@175776 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/base/content/browser.js | 4 ++-- mozilla/toolkit/components/help/content/help.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mozilla/browser/base/content/browser.js b/mozilla/browser/base/content/browser.js index ef377db1eac..867bf2a5f8b 100644 --- a/mozilla/browser/base/content/browser.js +++ b/mozilla/browser/base/content/browser.js @@ -2759,8 +2759,8 @@ function FillHistoryMenu(aParent, aMenu) } break; case "forward": - end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count; - if ((index + 1) >= end) return false; + end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count - 1; + if ((index + 1) > end) return false; for (j = index + 1; j <= end; j++) { entry = sessionHistory.getEntryAtIndex(j, false); diff --git a/mozilla/toolkit/components/help/content/help.js b/mozilla/toolkit/components/help/content/help.js index 59c3fc31409..2e3d91e4eea 100644 --- a/mozilla/toolkit/components/help/content/help.js +++ b/mozilla/toolkit/components/help/content/help.js @@ -457,8 +457,8 @@ function FillHistoryMenu(aParent, aMenu) } break; case "forward": - end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count; - if ((index + 1) >= end) return false; + end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count - 1; + if ((index + 1) > end) return false; for (j = index + 1; j <= end; j++) { entry = sessionHistory.getEntryAtIndex(j, false);