Bug 7586

Summary: less -M total number of lines and percentage wrong (before jumping to bottom)
Product: Busybox Reporter: Explorer09
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Explorer09 2014-11-01 01:56:25 UTC
$ seq 1 100 >seq.txt
$ less -M seq.txt

Status line says:
"seq.txt lines 1-23/100 21%"
Press 'q'

$ busybox less -M seq.txt

Status line says:
"seq.txt lines 1-23/24 96%"
                    ^^ ^^^ (Not 100 lines)
Press 'q'

$ seq 1 100 | less -M

"lines 1-23"
Press '>' and then press '<':
"lines 1-23/100 21%"
Press 'q'

$ seq 1 100 | busybox less -M

"standard input lines 1-23/24 96%"
                           ^^ ^^^
The total number of lines and percentage shouldn't be shown if stdin wasn't
finished reading (i.e. no EOF encountered yet).
Press '>' and then press '<':
"standard input lines 1-23/101 23%"
                           ^^^
('vi' and GNU 'less' say 100. I'm not complaining about this off-by-one, but it
could be a separate bug report.)
Comment 1 Ron Yorston 2020-01-25 11:33:01 UTC
Fixed by commit 193ba408a (less: improvements to verbose status messages). The first release containing this commit was 1.24.0.