aboutsummaryrefslogtreecommitdiff
path: root/miscutils/less.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'busybox' into mergeRon Yorston2026-03-111-59/+86
|\
| * less: unbreak EAGAIN propagationDenys Vlasenko2026-02-271-6/+12
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: make read error reporting actually visibleDenys Vlasenko2026-02-271-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta m_status_print 252 275 +23 status_print 111 122 +11 read_lines 783 775 -8 .rodata 107141 107131 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 34/-18) Total: 16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: improve O_NONBLOCK manipulations on stdinDenys Vlasenko2026-02-271-32/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | "less FILE" case needs it to be set just once. In other cases, manipulate it less often. function old new delta read_lines 702 783 +81 reinitialize 198 199 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 82/0) Total: 82 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: do not retry reads of stdin if got EAGAINDenys Vlasenko2026-02-271-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also: fewer syscalls to set/clear O_NONBLOCK, skip trying to read keyboard if poll() told us it's not ready. function old new delta reinitialize 184 198 +14 getch_nowait 251 258 +7 sched_yield 25 - -25 read_lines 815 702 -113 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 2/1 up/down: 21/-138) Total: -117 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2026-02-121-7/+7
|\|
| * *: use xasprintf_inplace() in more placesDenys Vlasenko2026-02-061-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta .rodata 107009 107018 +9 parse_stream 3075 3069 -6 buffer_print 612 603 -9 expand_args 159 144 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 9/-30) Total: -21 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2025-08-101-1/+1
|\|
| * shell: fix race between signal handlers setting bb_got_signal and poll()Denys Vlasenko2025-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta __ppoll_time64 - 211 +211 check_got_signal_and_poll - 164 +164 read_key 607 601 -6 shell_builtin_read 1328 1318 -10 ------------------------------------------------------------------------------ (add/remove: 4/0 grow/shrink: 0/2 up/down: 375/-16) Total: 359 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: add support for virtual terminal inputRon Yorston2023-03-051-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alter certain applets to support virtual terminal input, if enabled. In many places this is achieved by building previously excluded upstream terminal-handling code. The busybox-w32 implementation of termios(3) functions does nothing if virtual terminal input is disabled, so it can be invoked regardless. Some applet-specific terminal-handling code is also required. This affects less, more, vi and command line editing in the shell. (The `more` applet isn't enabled in the default configuration.) This series of patches adds about 1.7KB to the binaries.
* | Merge busybox into mergeRon Yorston2022-02-091-2/+2
|\| | | | | | | | | | | | | | | Fix conflicts in reset and ash. Redefine the new safe_read_key() as a reference to read_key(). Disable SHA256_HWACCEL.
| * ash,hush: fix handling of SIGINT while waiting for interactive inputDenys Vlasenko2022-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta lineedit_read_key 160 237 +77 __pgetc 522 589 +67 fgetc_interactive 244 309 +65 safe_read_key - 39 +39 read_key 588 607 +19 record_pending_signo 23 32 +9 signal_handler 75 81 +6 .rodata 104312 104309 -3 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 6/1 up/down: 282/-3) Total: 279 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge busybox into mergeRon Yorston2022-01-061-9/+13
|\| | | | | | | | | | | Fix merge conflict in miscutils/less.c. Use exit_SUCCESS() where possible.
| * libbb: code shrink: introduce and use [_]exit_SUCCESS()Denys Vlasenko2022-01-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta exit_SUCCESS - 7 +7 _exit_SUCCESS - 7 +7 run_pipe 1562 1567 +5 pseudo_exec_argv 399 400 +1 finish 86 87 +1 start_stop_daemon_main 1109 1107 -2 shutdown_on_signal 38 36 -2 runsv_main 1662 1660 -2 redirect 1070 1068 -2 read_line 79 77 -2 pause_and_low_level_reboot 54 52 -2 list_i2c_busses_and_exit 483 481 -2 less_exit 12 10 -2 identify 4123 4121 -2 grep_file 1161 1159 -2 getty_main 1519 1517 -2 fsck_minix_main 2681 2679 -2 free_session 132 130 -2 fdisk_main 4739 4737 -2 clean_up_and_exit 53 51 -2 bsd_select 1566 1564 -2 bb_daemonize_or_rexec 198 196 -2 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 3/17 up/down: 21/-34) Total: -13 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: code shrinkDenys Vlasenko2022-01-051-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta restore_tty - 29 +29 less_main 2107 2105 -2 getch_nowait 253 251 -2 buffer_print 614 612 -2 less_exit 51 12 -39 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/4 up/down: 29/-45) Total: -16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-10-131-1/+1
|\|
| * less: Ignore -XIsmael Luceno2021-09-281-1/+1
| | | | | | | | | | | | | | | | The flag disables termcap init/deinit of the terminal, which the applet doesn't do anyway. Signed-off-by: Ismael Luceno <ismael@iodev.co.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | less: use alternate screen bufferRon Yorston2019-04-071-1/+5
| |
* | Merge branch 'busybox' into mergeRon Yorston2019-01-101-1/+1
|\|
| * config: update size informationDenys Vlasenko2018-12-281-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-05-131-9/+14
|\|
| * less: fix fallout from "use common routine to set raw termios"Denys Vlasenko2018-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Testcase: (sleep 10; ls) | busybox less [...] ~ LICENSE ~ Makefile ~ Makefile.custom ~ Makefile.flags [...] less did not want this part: + /* dont convert NL to CR+NL on output */ + newterm->c_oflag &= ~(ONLCR); function old new delta get_termios_and_make_raw 108 115 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: remove unnecessary messageDenys Vlasenko2018-04-151-1/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: implement -FAaro Koskinen2018-04-151-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement -F option: Exit if entire file fits on first screen. function old new delta buffer_print 622 633 +11 less_main 2446 2449 +3 buffer_fill_and_print 169 172 +3 packed_usage 32258 32236 -22 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 17/-22) Total: -5 bytes Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: exclude termios codeRon Yorston2018-04-051-0/+6
| | | | | | | | | | The code to manipulate terminal settings serves no purpose in WIN32. Use conditional compilation to exclude much of it.
* | Merge branch 'busybox' into mergeRon Yorston2018-03-011-1/+5
|\|
| * less: accept -R option. Closes 10816Denys Vlasenko2018-02-271-1/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-02-131-4/+64
|\|
| * less: fix help text conditional for -RDenys Vlasenko2018-01-241-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: optional support of -RDenys Vlasenko2018-01-221-1/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on patches by Lubomir Rintel <lkundrak@v3.sk> function old new delta read_lines 653 722 +69 less_main 2464 2531 +67 packed_usage 32202 32239 +37 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 173/0) Total: 173 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: code shrinkDenys Vlasenko2018-01-081-3/+1
| | | | | | | | | | | | | | function old new delta less_main 2471 2464 -7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-09-271-18/+10
|\|
| * regularize format of source file headers, no code changesDenys Vlasenko2017-09-181-2/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less,microcom,lineedit: use common routine to set raw termiosDenys Vlasenko2017-09-151-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta get_termios_and_make_raw - 139 +139 xget1 39 8 -31 read_line_input 3912 3867 -45 less_main 2525 2471 -54 set_termios_to_raw 116 36 -80 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/4 up/down: 139/-210) Total: -71 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hexedit: implement "[enter] goto offset" keyDenys Vlasenko2017-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | This is a must if you need to edit sector 123456789999 on your /dev/disk. text data bss dec hex filename 922745 481 6832 930058 e310a busybox_old 923023 481 6832 930336 e3220 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hexedit: restore screen on exitDenys Vlasenko2017-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | function old new delta hexedit_main 998 1082 +84 restore_term - 29 +29 remap 168 173 +5 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 118/0) Total: 118 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: use ESC define instead of "\033"; use ESC[m instead of ESC[0mDenys Vlasenko2017-09-131-2/+2
| | | | | | | | | | | | | | | | text data bss dec hex filename 922535 481 6832 929848 e3038 busybox_old 922534 481 6832 929847 e3037 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hexedit: new appletDenys Vlasenko2017-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta hexedit_main - 930 +930 format_line - 197 +197 remap - 168 +168 move_mapping_further - 141 +141 move_mapping_lower - 107 +107 redraw_cur_line - 104 +104 packed_usage 31802 31812 +10 applet_names 2688 2696 +8 applet_main 1552 1556 +4 applet_suid 97 98 +1 applet_install_loc 194 195 +1 ------------------------------------------------------------------------------ (add/remove: 7/0 grow/shrink: 5/0 up/down: 1671/0) Total: 1671 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | less: avoid defining unused functionJohannes Schindelin2017-08-231-0/+2
| | | | | | | | | | | | | | | | This was forgotten in f4c43d4a2 (less: hide unsupported signal handling in include file, 2016-05-19). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-07-241-19/+19
|\|
| * config: deindent all help textsDenys Vlasenko2017-07-211-18/+18
| | | | | | | | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Update menuconfig items with approximate applet sizesDenys Vlasenko2017-07-181-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-05-291-1/+1
|\|
| * Spelling fixes in comments, documentation, tests and examplesDenys Vlasenko2017-04-171-1/+1
| | | | | | | | | | | | By klemens <ka7@github.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-02-081-4/+1
|\|
| * Big cleanup in config help and descriptionDenys Vlasenko2017-01-101-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Redundant help texts (one which only repeats the description) are deleted. Descriptions and help texts are trimmed. Some config options are moved, even across menus. No config option _names_ are changed. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2016-11-291-0/+4
|\|
| * Convert all miscutils/* applets to "new style" applet definitionsDenys Vlasenko2016-11-221-0/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch busybox (up to "ash: comment out free(p) just before...")Ron Yorston2016-10-191-12/+31
|\|
| * less: switch off nonblock on kbd_fd before exitDenys Vlasenko2016-09-131-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | This is only necessary if we use stdout fd. function old new delta less_exit 32 51 +19 less_main 2540 2543 +3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 22/0) Total: 22 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>