diff --git a/ArchiveState.go b/ArchiveState.go index 37e244f..bfa02df 100644 --- a/ArchiveState.go +++ b/ArchiveState.go @@ -74,6 +74,11 @@ func (this *ArchiveState) renderView(w http.ResponseWriter) { lines := strings.Split(string(fc), "\n") + // Work around #newpage: if the last line is blank, skip + if len(lines) > 0 && len(lines[len(lines)-1]) == 0 { + lines = lines[:len(lines)-1] + } + this.highestPage = int(math.Ceil(float64(len(lines))/float64(this.svr.cfg.LinesPerPage))) - 1 if this.page == pageNotSet || this.page > this.highestPage { this.page = this.highestPage