summaryrefslogtreecommitdiff
path: root/editors (follow)
Commit message (Collapse)AuthorAgeFilesLines
* vi: fix reading of file after last lineRon Yorston2014-12-051-1/+5
| | | | | | | | | | | | | | | | | | | If the :r command is used to read a file after the last line of the buffer the last line of the buffer and the first line of the file are joined. An extra blank line appears at the end of the buffer. file 1 file 1 file 1file 2 file 2 file 2 ~ ~ The insertion point is normally at the start of the line following the specified line. When the specified line is the last one the next_line function baulks at moving to the non-existent following line.
* vi: failure to open file is not an error when initialising bufferRon Yorston2014-12-051-7/+5
| | | | | | | | | | Commit 32afd3a introduced these regressions on the master branch: Starting vi with no filename on the command line gives the status message "'(null)' Bad address" instead of "- No file 1/1 100%". Starting vi with a non-existent file on the command line gives the status message "'new.txt' No such file or directory" instead of "- new.txt 1/1 100%"
* Merge branch 'busybox' into mergeRon Yorston2014-10-062-46/+46
|\
| * sed: fix "sed CMD -i nonexistent_file". Closes 7484Denys Vlasenko2014-10-051-2/+6
| | | | | | | | | | | | | | function old new delta sed_main 643 676 +33 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: fix a buglet in s///NUM handlingDenys Vlasenko2014-09-161-1/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix incorrect memory access on brace matching. Closes 7256Denys Vlasenko2014-09-151-43/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While at it, fix brace matching to actually show the match (missed fflush was causing cursor positioning to be buffered); shorten brace matching code; remove unused macro indirection in indicate_error(). Custom linker script 'busybox_ldscript' found, using it function old new delta indicate_error - 61 +61 mysleep 43 56 +13 char_insert 483 486 +3 find_pair 167 124 -43 Indicate_Error 61 - -61 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 2/1 up/down: 77/-104) Total: -27 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2014-06-301-0/+2
|\|
| * awk: fix handling of "if ... break ; else ..." - closes 7226Denys Vlasenko2014-06-261-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2014-05-061-189/+606
|\| | | | | | | | | | | | | Conflicts: debianutils/which.c editors/vi.c libbb/executable.c
| * vi: some simplificationsDenys Vlasenko2014-04-051-116/+120
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta file_insert 301 315 +14 init_text_buffer 179 171 -8 colon 2889 2878 -11 file_size 37 - -37 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/2 up/down: 14/-56) Total: -42 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: clear undo buffer when we change to another fileDenys Vlasenko2014-04-031-69/+87
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta init_text_buffer 156 190 +34 undo_push 360 382 +22 count_lines 74 72 -2 undo_pop 246 222 -24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 56/-26) Total: 30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: undo code shrinkDenys Vlasenko2014-04-031-41/+42
| | | | | | | | | | | | | | | | function old new delta undo_push 414 395 -19 do_cmd 4803 4761 -42 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: undo support for vi with intermediate queuingJody Bruchon2014-04-021-54/+448
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta undo_push - 411 +411 undo_pop - 288 +288 do_cmd 4160 4426 +266 char_insert 363 483 +120 undo_queue_commit - 61 +61 text_hole_delete 108 163 +55 string_insert 94 127 +33 colon 2864 2882 +18 yank_delete 92 101 +9 vi_main 273 280 +7 dot_scroll 88 93 +5 dot_right 29 34 +5 dot_prev 20 25 +5 dot_next 20 25 +5 dot_left 24 29 +5 dot_end 20 25 +5 dot_begin 20 25 +5 init_text_buffer 154 156 +2 text_hole_make 145 142 -3 file_insert 333 318 -15 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 15/2 up/down: 1305/-18) Total: 1287 bytes (without queuing it's ~870 bytes) Signed-off-by: Jody Bruchon <jody@jodybruchon.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | awk: treat \r as a space character to skipRon Yorston2014-01-131-0/+4
| |
* | Merge branch 'busybox' into mergeRon Yorston2014-01-028-215/+285
|\| | | | | | | | | | | Conflicts: archival/Config.src shell/ash.c
| * sed: accept s///i as a synonym for s///I ("ignore case")David A. Wheeler2013-12-181-1/+2
| | | | | | | | | | Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Use unsigned printf/scanf conversion where more appropriateDenys Vlasenko2013-11-291-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: code shrinkDenys Vlasenko2013-11-281-28/+21
| | | | | | | | | | | | | | | | | | | | | | function old new delta get_next_line 246 250 +4 sed_main 671 662 -9 add_input_file 47 - -47 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 4/-56) Total: -52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: open input files sequentially to avoid EMFILEDenys Vlasenko2013-11-281-26/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, sed pre-opens all files, which may cause EMFILE errors on systems with low ulimit -n. Change sed to open one file at a time. function old new delta get_next_line 177 235 +58 sed_main 682 652 -30 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 58/-30) Total: 28 bytes Based on the patch by Daniel Borca <dborca@yahoo.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: fix a bug in argc counting in recent changeDenys Vlasenko2013-11-211-8/+8
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * switch editors/* to embedded-in-source kbuild systemDenys Vlasenko2013-11-136-49/+61
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: optionally support -e AWK_PROGSven-Göran Bergh2013-11-123-41/+84
| | | | | | | | | | | | | | | | function old new delta awk_main 959 978 +19 Signed-off-by: Sven-Göran Bergh <sgb@systemasis.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: fix "sed clusternewline" testcaseDenys Vlasenko2013-10-301-67/+67
| | | | | | | | | | | | | | | | | | | | | | function old new delta process_files 2197 2226 +29 flush_append 47 54 +7 get_next_line 184 189 +5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 41/0) Total: 41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: document -E in help textDenys Vlasenko2013-10-301-3/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: fix memory leak in 'r FILE' commandDenys Vlasenko2013-10-301-4/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: accept -E as a synonym for -rDavid A. Wheeler2013-10-291-4/+10
| | | | | | | | | | Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: fix length(array)Denys Vlasenko2013-10-121-1/+9
| | | | | | | | | | | | | | function old new delta evaluate 3526 3548 +22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2013-08-273-63/+43
|\|
| * awk: Fix handling of functions with empty bodyBernhard Reutner-Fischer2013-07-311-1/+1
| | | | | | | | | | | | | | ammend b79a0fef99627c457548e804fcd6e162b116cbe8 to properly handle functions defined in another scope. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * sed: fix matching of newlines by $Denys Vlasenko2013-07-211-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: use "long long" as integer type, not "int"Denys Vlasenko2013-07-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Testcase: awk "BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}" 2147483647 2147483647 0 2147483648 2147483648 0 (last three values weren't showing right) function old new delta evaluate 3444 3458 +14 fmt_num 221 230 +9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: remove now-redundant backslash-newline handlingDenys Vlasenko2013-07-081-16/+2
| | | | | | | | | | | | | | | | | | | | | | 4b0bb9e0fd9ec06e9e61b1a1527ace99ea9fe571 added this code in 2007, then in a2215b98f7d65bc613b9c8f008d79672402c6a07 more general fix was added. function old new delta add_cmd_block 98 58 -40 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: document where we are more liberal then GNUDenys Vlasenko2013-07-081-0/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: make regexp search case-insensitive if ":set ignorecase" is activeDenys Vlasenko2013-04-211-40/+28
| | | | | | | | | | | | Reported by Dan Moinescu <dan@moinescu.net>. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | vi: handle CRLF line endingRon Yorston2013-03-191-0/+38
| |
* | Merge branch 'busybox' into mergeRon Yorston2013-03-192-6/+13
|\|
| * vi: code shrinkDenys Vlasenko2013-03-151-4/+10
| | | | | | | | | | | | | | | | | | | | | | function old new delta status_line_bold_errno - 32 +32 colon 2891 2873 -18 file_insert 354 313 -41 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 32/-59) Total: -27 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix adjustment of buffer on partial file readRon Yorston2013-03-151-1/+1
| | | | | | | | | | | | | | | | The second argument to text_hole_delete was incorrect: it should be a pointer to the end of the hole. Signed-off-by: Ron Yorston <rmy@tigress.co.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: Fix handling of functions with empty bodyBernhard Reutner-Fischer2013-03-131-1/+2
| | | | | | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* | Merge branch 'busybox' into mergeRon Yorston2013-02-074-23/+23
|\|
| * *: reuse more stringsDenys Vlasenko2013-01-221-14/+14
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * whitespace fixes. no code changesDenys Vlasenko2013-01-152-6/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * whitespace cleanup. no code changesDenys Vlasenko2013-01-143-3/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2012-09-073-170/+166
|\| | | | | | | | | | | Conflicts: include/libbb.h shell/ash.c
| * sed: allow 'w' cmd to use two address formMimi Li2012-07-241-5/+11
| | | | | | | | | | | | | | | | function old new delta add_cmd 1101 1094 -7 Signed-off-by: Mimi Li <felloak@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: fix FS assignment behavior. Closes 5108Denys Vlasenko2012-07-111-0/+12
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: make -F STR interpret escape sequences. Closes 5126Denys Vlasenko2012-06-221-7/+19
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tweak help textsDenys Vlasenko2012-06-211-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: save/restore screen upon invocationDenys Vlasenko2012-06-111-0/+4
| | | | | | | | | | | | | | function old new delta vi_main 253 273 +20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: nuke FEATURE_VI_OPTIMIZE_CURSORDenys Vlasenko2012-06-111-124/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not Unicode safe, it is not saving much of I/O, and it's large: function old new delta vi_main 255 253 -2 go_bottom_and_clear_to_eol 28 26 -2 do_cmd 4194 4182 -12 show_status_line 388 374 -14 strncat 39 - -39 __GI_strncat 39 - -39 refresh 774 724 -50 place_cursor 276 83 -193 ------------------------------------------------------------------------------ (add/remove: 0/3 grow/shrink: 0/6 up/down: 0/-351) Total: -351 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>