Bug 7586 - less -M total number of lines and percentage wrong (before jumping to bottom)
Summary: less -M total number of lines and percentage wrong (before jumping to bottom)
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-01 01:56 UTC by Explorer09
Modified: 2020-01-25 11:33 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.