LoupLobet

LoupLobet

Member Since 2 years ago

France

Experience Points
4
follower
Lessons Completed
0
follow
Lessons Completed
2
stars
Best Reply Awards
6
repos

52 contributions in the last year

Pinned
⚡ A Plan9-inspired, mouse-oriented, graphical menu, which works with the standard input.
⚡ A plumber written in Go, working without 9p, adapted to UNIX-like operating systems, and concurrent.
⚡ Simple X Displayer: a mouse-oriented, multi-purpose text displayer.
Activity
Nov
25
1 week ago
Activity icon
issue

LoupLobet issue 9fans/plan9port

LoupLobet
LoupLobet

Avoid page(1) to terminate when the end of the document is reached

First yhis issue was noticed on the OpenBSD package of plan9port, I don't know if this remains an issue in the current plan9port version, or if the issue is related to OpenBSD as a system.

When you reach the end of a document, or viewing a simple image with page(1), if you try to go the next (non existant) page, the program terminates (that's not something that happen on a real plan9 install).

I kind of fixed the problem on my own: (these are changes i made on view.c) `437,438c437,439 < if(!doc->npage || page + 1 < doc->npage || doc->fwdonly) < showpage(++page, &menu);

  		if(doc->npage && ++page >= doc->npage && !doc->fwdonly)
  			wexits(0);
  		showpage(page, &menu);

520c521 < if(reverse) page++;

  				if(reverse) return;

525c526 < page--;

  				return;

536c537 < if(reverse) page++;

  				if(reverse) return;

540,541c541,542 < if((page >= doc->npage) && !doc->fwdonly) < page--;

  			if((page >= doc->npage) && !doc->fwdonly && !reverse)
  				return;

`