Description: Fix handling of KEY_PREVNODE* + KEY_NEXTNODE* in manpages KEY_PREVNODE* and KEY_NEXTNODE* had no effect in manpages. Even worse, pressing KEY_PREVNODE* while at the top of a manpage caused a segfault. This patch (re-)introduces the functionality described in pinfo's manpage. Author: Sven Geuer Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021526 Forwarded: https://github.com/baszoetekouw/pinfo/pull/41 Last-Update: 2025-03-03 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/src/manual.c +++ b/src/manual.c @@ -1310,7 +1310,7 @@ { for (unsigned i = manualpos + 1; i < ManualLines; i++) { - if (manual[i][1] == 8) + if (!isspace(manual[i][0])) { manualpos = i; break; @@ -1321,9 +1321,9 @@ if ((key == keys.prevnode_1) || (key == keys.prevnode_2)) { - for (unsigned i = manualpos - 1; i > 0; i--) + for (unsigned i = (manualpos ? manualpos - 1 : 0); i > 0; i--) { - if (manual[i][1] == 8) + if (!isspace(manual[i][0])) { manualpos = i; break;