]> git.ipfire.org Git - thirdparty/util-linux.git/commit - text-utils/more.c
more: refactor and clarify code
authorSami Kerola <kerolasa@iki.fi>
Wed, 18 Mar 2020 20:13:16 +0000 (20:13 +0000)
committerSami Kerola <kerolasa@iki.fi>
Sat, 28 Mar 2020 07:55:59 +0000 (07:55 +0000)
commit5cd45502516263fc50a851b8a30263490e3a7f6c
tree7fc3027e4e9b05aa7c3a309943fb4ba5b2903a48
parent63f96f682f7ee1f78ff0dbf0925aaee6814f94e8
more: refactor and clarify code

Use the backspace provided dy terminfo, and if that is not possible use
fallback.

Simplify entering and exiting standard mode.  Now when these std_enter and
std_exit variables are initialized correctly they do not need to be checked
quite as complex way as earlier.

Do not call prepare_line_buffer() unnecessarily.  The line buffer needs only
to be prepared only at times of more(1) initialization and when terminal
size changes.

Add a function to print various separators, that is better than static
strings.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/more.c