less: fix display of line numbers
authorRon Yorston <rmy@frippery.org>
Sat, 18 Jul 2015 15:20:03 +0000 (16:20 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 19 Jul 2015 20:48:05 +0000 (22:48 +0200)
commitf06386ad4f5e1e5b5a3aea71ac757d5be8574067
treef45448523ab56a43efc09aae7ac6d9a3b2d09404
parent51aa861843002e92b605be840460e7141d4d86a2
less: fix display of line numbers

Line numbers are displayed incorrectly on lines that have a search
pattern highlighted.  The problem can be fixed by moving the call to
lineno_str in print_found above the while loop that alters the value
of the line pointer.  However, a more substantial rewrite results in
savings.

function                                             old     new   delta
buffer_print                                         688     697      +9
.rodata                                           156077  156045     -32
lineno_str                                            85       -     -85
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 9/-117)           Total: -108 bytes

Signed-off-by: Ron Yorston <rmy@frippery.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/less.c