int prevIndex = 0;
nsSessionHistory::Goto(PRInt32 aGotoIndex, nsIWebShell * prev, PRBool aIsReload){   nsresult rv = NS_OK;   PRBool result = PR_FALSE;   int prevIndex = 0;   if ((aGotoIndex < 0) ||  (aGotoIndex >= mHistoryLength))      return NS_ERROR_NULL_POINTER;   nsHistoryEntry * hPrevEntry=nsnull, * hCurrentEntry = nsnull;   //get a handle to the current page to be passed to nsHistoryEntry   // as the previous page.   hCurrentEntry = (nsHistoryEntry *) mHistoryEntries.ElementAt(aGotoIndex);   // Set the flag that indicates that we are currently   // traversing with it the history   mIsLoadingDoc = PR_TRUE;   mHistoryEntryInLoad = hCurrentEntry;  //Load the page   const PRUnichar * url;   hCurrentEntry->GetURL(&url);   nsString  urlString(url);   if (APP_DEBUG) printf("nsSessionHistory::Goto, Trying to load URL %s\n", urlString.ToNewCString());      if (hCurrentEntry != nsnull)       result = hCurrentEntry->Load(prev, aIsReload);    if (!result) {       mIsLoadingDoc = PR_FALSE;       mHistoryEntryInLoad = (nsHistoryEntry *) nsnull;    }#if 0  if (aIsReload) {     prev->LoadURL(urlString.GetUnicode(), nsnull, PR_FALSE);   }  else {    if (hCurrentEntry != nsnull)       result = hCurrentEntry->Load(prev);  }     if (!result) {     mIsLoadingDoc = PR_FALSE;     mHistoryEntryInLoad = (nsHistoryEntry *) nsnull;  }#endif  /* 0 */     mHistoryCurrentIndex = aGotoIndex;   return NS_OK;}