aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c
AgeCommit message (Collapse)Author
2008-06-24vi: fix yet another vda's thinkoDenis Vlasenko
2008-06-22vi: fix obvious thinko'sDenis Vlasenko
2008-06-22vi: fix vda's breakage (by Cristian Ionescu-Idbohrn)Denis Vlasenko
2008-06-21vi: small code shrinkDenis Vlasenko
function old new delta file_insert 328 329 +1 colon 3067 3064 -3 string_insert 93 89 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 1/-7) Total: -6 bytes
2008-06-20vi: fix the bug where vi never grows the edit buffer.Denis Vlasenko
vi: do G trick on it function old new delta place_cursor 264 276 +12 next_tabstop 22 34 +12 mycmp 44 52 +8 status_line 34 40 +6 yank_delete 89 92 +3 what_reg 34 37 +3 suspend_sig 63 66 +3 find_range 493 496 +3 redraw 104 106 +2 cont_sig 63 65 +2 Indicate_Error 59 61 +2 status_line_bold 71 72 +1 file_insert 327 328 +1 vi_setops 1 - -1 ... cmdcnt 4 - -4 chars_to_parse 4 - -4 ccol 4 - -4 dot_scroll 88 79 -9 stupid_insert 28 18 -10 winch_sig 102 91 -11 char_insert 353 336 -17 readit 354 336 -18 get_one_char 128 110 -18 init_text_buffer 171 152 -19 text_hole_delete 132 112 -20 edit_file 940 918 -22 get_input_line 198 168 -30 show_status_line 449 408 -41 colon 3112 3067 -45 vi_main 312 250 -62 refresh 1077 974 -103 do_cmd 4818 4483 -335 ------------------------------------------------------------------------------ (add/remove: 0/38 grow/shrink: 13/20 up/down: 58/-889) Total: -831 bytes text data bss dec hex filename 809566 612 7044 817222 c7846 busybox_old 808794 611 6924 816329 c74c9 busybox_unstripped text data bss dec hex filename 18888 1 122 19011 4a43 busybox.t8/editors/vi.o 18116 0 0 18116 46c4 busybox.t9/editors/vi.o
2008-05-19- use STD*_FILENO some more. No object-code changesBernhard Reutner-Fischer
2008-05-18more -Wall warning fixes. -Wall is enabled now.Denis Vlasenko
2008-05-13more -Wall warning fixes from Cristian Ionescu-Idbohrn.Denis Vlasenko
This time it resulted in small code changes: function old new delta nexpr 820 828 +8 tail_main 1200 1202 +2 wrapf 166 167 +1 parse_mount_options 227 209 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 11/-18) Total: -7 bytes
2008-05-03vi: do not truncate file to zero length. closes bug 2944.Denis Vlasenko
function old new delta file_write 98 104 +6
2008-03-24*: whitespace fixes, no code changesDenis Vlasenko
2008-03-24lpr: add more accurate commentsDenis Vlasenko
*: trailing whitespace removal
2008-03-17remove alarm() calls which were functioning as a primitivePaul Fox
watchdog function, presumably to catch infinite loop bugs. (control-C can do the same thing, and the alarms were too short in any case.) also, switch to sigsetjmp/siglongjmp in order to allow repeated use of control-C -- otherwise it works once, then not again.
2008-03-17*: add -Wunused-parameter; fix resulting breakageDenis Vlasenko
function old new delta procps_scan 1265 1298 +33 aliascmd 278 283 +5 parse_file_cmd 116 120 +4 dname_enc 373 377 +4 setcmd 90 93 +3 execcmd 57 60 +3 count_lines 72 74 +2 process_command_subs 340 339 -1 test_main 409 407 -2 mknod_main 179 177 -2 handle_incoming_and_exit 2653 2651 -2 argstr 1312 1310 -2 shiftcmd 131 128 -3 exitcmd 46 43 -3 dotcmd 297 294 -3 breakcmd 86 83 -3 evalpipe 353 349 -4 evalcommand 1180 1176 -4 evalcmd 109 105 -4 send_tree 374 369 -5 mkfifo_main 82 77 -5 evalsubshell 152 147 -5 typecmd 75 69 -6 letcmd 61 55 -6 add_cmd 1190 1183 -7 main 891 883 -8 ash_main 1415 1407 -8 parse_stream 1377 1367 -10 alloc_procps_scan 55 - -55 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148) Total: -94 bytes text data bss dec hex filename 797195 658 7428 805281 c49a1 busybox_old 797101 658 7428 805187 c4943 busybox_unstripped
2008-03-06fixups to vi usage, and move the initial redraw() past thePaul Fox
execution of commands supplied by -c or EXINIT, so their effect is displayed correctly.
2008-03-06fixed the "dot" (i.e. '.') command, to properly re-init itsPaul Fox
buffer between commands, not recalculate its length all the time, and to not reallocate its fixed-length buffer frequently. fixed the 'c', 'd', and 'y' commands to properly handle both motions that are just part of a line, and those that are multiline. for instance, now "c%" and "2cw" work correctly, whether the motions span lines or not. added some permissble motions for 'c', 'd', and 'y': namely 'h', 'l', SPACE, BS, and DEL
2008-03-05fix vi's '?' and '/' commands to correctly set a new directionPaul Fox
when reusing a previous search pattern. previously only 'n' and 'N' reversed directions properly.
2008-02-27*: add optimization barrier to all "G trick" locationsDenis Vlasenko
2008-02-14add ',' and 'gg' commands (patch from Leo Jay)Paul Fox
2008-02-11- spelling fixesBernhard Reutner-Fischer
2007-12-30libbb: introduce fputc_printable (from ed)Denis Vlasenko
netstat: print control chars as ^C etc vi: style fixlet function old new delta fputc_printable - 100 +100 unix_do_one 451 487 +36 printLines 258 190 -68 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 136/-68) Total: 68 bytes
2007-12-23vi: speed up some string opsDenis Vlasenko
2007-12-22vi: reduce amount of memset'ing on each screen refreshDenis Vlasenko
2007-12-22vi: introduce FEATURE_VI_8BIT (as vi currently is not Unicode capable,Denis Vlasenko
people may want to disable display of high-bit chars) ip: build fixlet
2007-12-22vi: change MAX_LINELEN meaning: now it is the biggest supportedDenis Vlasenko
screen wigth. Introduce MAX_TABSTOP and MAX_INPUT_LEN. Fix redraw of very long lines and cursor movement past NULs.
2007-12-21vi: fix a problem with displaying overlong linesDenis Vlasenko
2007-12-09vi: don't use common_bufsiz as read buffer, it can be too smallDenis Vlasenko
(found by Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>)
2007-10-11vi: don't wait 50 ms before reading ESC sequencesDenis Vlasenko
inetd,syslogd: use safe_read instead of open-coded EINTR handling syslogd: bail out if you see null read from Unix socket (should never happen, but if it does, spinning forever and eating 100% CPU is not a good idea)
2007-10-11add -fvisibility=hidden to CC flags, mark XXX_main functionsDenis Vlasenko
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-10-01- ditch 2 bytesBernhard Reutner-Fischer
2007-09-27introduce bb_putchar(). saves ~1800 on uclibc (less on glibc).Denis Vlasenko
2007-09-27introduce safe_poll (fixes a problem in top)Denis Vlasenko
function old new delta safe_poll - 77 +77 svlogd_main 1470 1466 -4 zcip_main 1530 1524 -6 forkexec 1345 1338 -7 decode_format_string 795 788 -7 collect_blk 474 467 -7 buffer_pread 540 532 -8 tftp 1182 1172 -10 microcom_main 763 749 -14 arpping 441 424 -17 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/9 up/down: 77/-80) Total: -3 bytes text data bss dec hex filename 770162 1034 10404 781600 bed20 busybox_old 770158 1034 10404 781596 bed1c busybox_unstripped
2007-09-22- actually mv microcom.c to miscutilsBernhard Reutner-Fischer
2007-09-07*: replace select-for-one descriptor with poll, it's smaller.Denis Vlasenko
$ ./.cmk bloatcheck function old new delta readit 406 364 -42 syslogd_main 1249 1206 -43 traceroute_main 4115 4060 -55 mysleep 112 45 -67 arpping 579 441 -138 tftp 1575 1182 -393 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-738) Total: -738 bytes text data bss dec hex filename 770580 1051 10764 782395 bf03b busybox_old 769820 1051 10764 781635 bed43 busybox_unstripped
2007-08-17assorted fixes for breakage found by randomconfigDenis Vlasenko
2007-08-16whitespace fixes, no code changesDenis Vlasenko
2007-08-12trylink: produce even more info about final link stageDenis Vlasenko
trylink: explain how to modify link and drastically decrease amount of padding (unfortunately, needs hand editing ATM). *: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts size saving: 0.5k
2007-07-21style fix (stray space before ';')Denis Vlasenko
2007-07-19stray trailing tabs removedDenis Vlasenko
2007-07-18vi: comment out dead codeDenis Vlasenko
2007-07-17vi: style fixletDenis Vlasenko
2007-07-17fix typo in prev commit :(Denis Vlasenko
2007-07-17vi: s/argv[0]/applet_name/Denis Vlasenko
2007-07-17vi: multiple fixes by Natanael Copa <natanael.copa@gmail.com>Denis Vlasenko
* the puzzling message on error is replaced with strerror(errno) so it should be even more detailed and smaller at the same time. * merged code in edit_file() and code for ':edit <file>' in colon() into new func init_text_buffer(). Was horribly duplicate. Moved most of error/sanity checking to file_insert(). Result is that you get a proper validation (prevent reading /dev/*) and error messages for ':r <file>' * renamed 'cfn' to 'current_filename' for improved readability * merged smallint vi_readonly and readonly into bitfields into readonly_mode to save space. * added text_size variable to keep track how big the text buffer is. This is used to fix a buffer overflow. To reproduce bug: ./busybox vi TODO :r Makefile vi segfaults due to no buffer checking is done at all. som redesign is needed here but i added a check in text_hole_make() to aviod the segfault at least. * removed isblnk() and use isblank(3) instead. * fixed compiler warning by displaying the return code for :!<command> This makes things bigger than needed but since the patch reduces the overall size... (see below) * new func next_tabstop(int) merges some duplicate code. There are more cuplicode here but i couldnt find a good way to merge them. * Fix *ANNOYING* placement of cursor on '\t' characters. To reproduce: echo -e "\thello" > file1 ./busybox vi file1 Try to insert some text at the beginning of line. Text will be inserted but cursor is blinking somewhere else. The patch should make busybox vi behave more like original vi(m). Costs a few bytes but its worth it imho. * new_text() is moved into init_text_buffer() * the previously added update_ro_status() was moved info file_insert due to duplication removal mentioned above. function old new delta init_text_buffer - 245 +245 file_insert 312 420 +108 next_tabstop - 82 +82 text_hole_make 154 171 +17 do_cmd 5093 5100 +7 static.cmd_mode_indicator - 5 +5 refresh 1248 1253 +5 current_filename - 4 +4 yank_delete 161 164 +3 what_reg 96 99 +3 end_cmd_q 78 81 +3 char_insert 440 442 +2 readonly_mode - 1 +1 vi_readonly 1 - -1 setops 154 153 -1 readonly 1 - -1 vi_setops 4 1 -3 string_insert 161 158 -3 cfn 4 - -4 show_status_line 532 514 -18 readit 519 500 -19 move_to_col 161 138 -23 vi_main 495 433 -62 isblnk 75 - -75 .rodata 4751 4655 -96 edit_file 892 787 -105 new_text 125 - -125 update_ro_status 131 - -131 colon 3848 3667 -181 ------------------------------------------------------------------------------ (add/remove: 5/6 grow/shrink: 8/10 up/down: 485/-848) Total: -363 bytes text data bss dec hex filename 34751 873 4260 39884 9bcc busybox_old 34439 877 4260 39576 9a98 busybox_unstripped
2007-07-17remove accumulated stray trailing whitespaceDenis Vlasenko
2007-07-14vi: make status line less confusing when we open non-readable files,Denis Vlasenko
require rood to use w! when saving non-writable files. Patch by Natanael Copa <natanael.copa@gmail.com> update_ro_status - 73 +73 edit_file 819 822 +3 colon 3440 3425 -15 .rodata 128090 128058 -32 file_insert 288 235 -53 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/3 up/down: 76/-100) Total: -24 bytes text data bss dec hex filename 673344 2740 13968 690052 a8784 busybox_old 673320 2740 13968 690028 a876c busybox_unstripped
2007-06-25Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms ↵Denis Vlasenko
<wharms@bfs.de>)
2007-06-10moved biggest stack buffers to malloc space, or made their size configurableDenis Vlasenko
(8k of shell line edit buffer is an overkill) # make ARCH=i386 bloatcheck function old new delta read_line_input 3933 3967 +34 ifaddrlist 348 345 -3 do_loadfont 208 191 -17 edit_file 840 819 -21 .rodata 129112 129080 -32 uncompress 1305 1268 -37 loadfont_main 566 495 -71 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/6 up/down: 34/-181) Total: -147 bytes
2007-05-30vi: move some data to malloc'ed space: ~500 less bss, codeDenis Vlasenko
size is smaller too (subject to arch differenced I guess)
2007-05-26usage.c: remove reference to busybox.hDenis Vlasenko
*: s/include "busybox.h"/include "libbb.h"
2007-05-17vi: remove two globalsDenis Vlasenko
awk: some 'lineno' vars were shorts, made them ints (code got smaller) awk: rename global t to global ttt. still an awful name, but at least you can grep for it now. function old new delta ttt - 28 +28 mysleep 104 120 +16 readit 408 418 +10 lineno 2 4 +2 parse_program 338 339 +1 evaluate 6446 6445 -1 syntax_error 25 23 -2 next_token 917 915 -2 new_node 26 24 -2 tv 16 8 -8 skip_spaces 68 53 -15 t 28 - -28 rfds 128 - -128 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 4/6 up/down: 57/-186) Total: -129 bytes