aboutsummaryrefslogtreecommitdiff
path: root/editors (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * vi: allow manual screen update if SIGWINCH isn't supportedRon Yorston2019-03-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On platforms that don't support SIGWINCH vi can be configured with FEATURE_VI_USE_SIGNALS disabled and FEATURE_VI_WIN_RESIZE enabled. This allows the user to force an update with ^L when the screen is resized. However, because the SIGWINCH handler hasn't run the virtual screen buffer won't have been updated and the display becomes corrupted. Fix this by calling new_screen() if necessary. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: code shrink, proper printf formatting for strlen()Denys Vlasenko2019-03-291-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta yank_delete 98 99 +1 what_reg 34 33 -1 text_yank 56 54 -2 end_cmd_q 17 14 -3 do_cmd 4718 4705 -13 colon 2875 2861 -14 edit_file 668 648 -20 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/6 up/down: 1/-53) Total: -52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | vi: improve reliability of pasted textRon Yorston2019-03-171-2/+2
| | | | | | | | | | Increase the allowed number of outstanding events in the input queue to two.
* | vi: fix spurious error on opening file with CRLF line endingsRon Yorston2019-03-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 91e49fbc7 (vi: add a function to count CRs in the text buffer) resulted in the spurious error "can't read 'file'" when opening a file with CRLF line endings. This was because the count function was called with an incorrect pointer into the text buffer. The upstream code: p = text_hole_delete(p + cnt, p + size - 1, NO_UNDO); unnecessarily updates the pointer p: it's never used again.
* | win32: fix POSIX build (again)Ron Yorston2019-03-121-1/+3
| | | | | | | | | | Some faulty logic with ENABLE_FEATURE_EXTRA_FILE_DATA broke the POSIX build.
* | win32: stat(2) succeeds if fetching extra metadata failsRon Yorston2019-02-191-1/+3
| | | | | | | | | | | | | | | | | | Some files can't be opened to fetch additional metadata. When that happens allow stat(2) to successfully return what data it has. In a few cases where the inode number is used to determine if files are identical ignore invalid inode numbers.
* | win32: make stat(2) fetch additional metadataRon Yorston2019-02-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify the WIN32 implementation of stat(2) to fetch inode number, device id and number of hardlinks. This requires opening a handle to the target file so it will be slower. A number of features can be enabled or start to work: - tar can detect if an archive is being stored in itself; - find can support the -inum and -links options; - ls can display inode numbers; - diff can detect attempts to compare a file with itself; - du has better support for hardlinked files; - cp can detect attempts to copy a file over itself.
* | vi: add a function to count CRs in the text bufferRon Yorston2019-02-141-29/+27
| |
* | win32: add a function to remove CRs from a text bufferRon Yorston2019-02-141-14/+5
| |
* | Merge branch 'busybox' into mergeRon Yorston2019-02-123-72/+77
|\|
| * vi: further fixes to undo after autoindentRon Yorston2019-02-111-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit bb983f30e (vi: fix faulty undo after autoinsert) has a number of problems: - The commit message refers to 'autoinsert' when it really means 'autoindent'. - The indentation of undo_push_insert() was incorrect. - Most seriously the commit only fixed the problem for cases where the indentation was exactly one character. This is because undo_push() only allows single characters to be queued for UNDO_INS_QUEUED. Lifting this restriction allows the example given in the previous commit message (with a three character indent) to work. function old new delta undo_push 406 435 +29 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 29/0) Total: 29 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix replacement of single character with CRRon Yorston2019-02-081-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if the 'r' command is followed by a carriage return a literal CR replaces the current character. Fix this so that: - a new line is inserted - the autoindent setting is respected - the cursor is placed at the start of the new line function old new delta do_cmd 5052 5060 +8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 8/0) Total: 8 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix faulty undo after autoinsertRon Yorston2019-02-081-35/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable autoinsert and enter the following with an indent of three spaces: line 1 line 2 Using 'u' to undo the last insert results in: line1e 2 The insertion of the indent hasn't been properly recorded. Since recording insertions is a common operation add a convenience function, undo_push_insert(), to handle this and use it to record the autoindent correctly. function old new delta undo_push_insert - 36 +36 string_insert 133 129 -4 char_insert 518 473 -45 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 36/-49) Total: -13 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: code shrinkDenys Vlasenko2019-01-211-15/+15
| | | | | | | | | | | | | | function old new delta parse_file_cmd 115 94 -21 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: Fix backslash parsing for 'w' command argBrian Foley2019-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | If there's any whitespace between w and the filename, parse_file_cmd writes to the wrong offset when trying to fix up backslashes. This can be seen in the asan build with busybox sed -e 'w 0\\' Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: Fix overly permissive func arg list parsingBrian Foley2019-01-211-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It allows things like 'func f(a b)' and 'func f(a,)' which GNU awk forbids. function old new delta parse_program 327 367 +40 chain_expr 40 67 +27 parse_expr 891 915 +24 EMSG_TOO_FEW_ARGS 30 18 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 91/-12) Total: 79 bytes Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: Syntax error if delete isn't given an arg.Brian Foley2019-01-211-8/+15
| | | | | | | | | | | | | | | | Unlike exit and return, delete strictly requires an arg, and derefs a null pointer if executed without one. Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: Guard pointer chasing when parsing ternary expressions.Brian Foley2019-01-211-1/+2
| | | | | | | | | | | | | | | | | | Avoids an uninit pointer deref for some malformed ternary exprs. Add a test that would crash in busybox before this fix. Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | vi: simplify code to display pasted textRon Yorston2019-02-011-8/+4
| |
* | vi: display pasted textRon Yorston2019-01-261-1/+14
| | | | | | | | | | | | | | | | | | | | vi tries to avoid updating the display if more input is available. This didn't work when text was pasted in because a key release event was left in the event queue. When mysleep() is called to test for this condition allow up to one event to be present in the queue before reporting that input is available.
* | awk: fix handling of regular expressions that match end-of-lineRon Yorston2019-01-231-0/+24
| | | | | | | | | | | | | | | | awk failed to match regular expressions that included an end-of-line: it was looking for a LF whereas lines were terminated by CRLF. Rather than tinker with the regex code or arrange for input to be in text mode I've stripped CRs from the input.
* | Merge branch 'busybox' into mergeRon Yorston2019-01-106-6/+6
|\|
| * config: update size informationDenys Vlasenko2018-12-286-6/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | diff: omit unreliable test for same fileRon Yorston2019-01-091-1/+1
| | | | | | | | | | | | | | | | diff tries to detect if it's been asked to compare a file with itself. Because much of the information returned by stat(2) is fake (in particular, the inode number) this results in false positives. Simply omit the unreliable test.
* | Merge branch 'busybox' into mergeRon Yorston2018-12-052-18/+29
|\|
| * vi: correctly detect when a deletion empties the bufferRon Yorston2018-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Michał Berger has reported two issues: - Repeatedly deleting and undoing the deletion of the last line results in characters being lost from the end of the line. - Deleting the bottom line twice then attempting to undo each of these deletions results in a segfault. The problem seems to be an incorrect test for whether the text buffer is empty. Reported-by: Michał Berger <michallinuxstuff@gmail.com> Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: code shrinkDenys Vlasenko2018-11-291-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta char_search 241 247 +6 get_one_address 275 272 -3 colon 2878 2875 -3 do_cmd 4726 4720 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 6/-12) Total: -6 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix FEATURE_VI_REGEX_SEARCH to respect LIMITED (one-line) searchDenys Vlasenko2018-11-291-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If busybox is compiled with FEATURE_VI_REGEX_SEARCH enabled, command ":s/x/y/" searches not only in the current line, but continues search after it. This makes range searches (":1,3s/x/y/") work incorrect. For example file "./test": 1 2 3 $ vi ./test :1,2s/3/e/ gives us: 1 2 e function old new delta char_search 213 241 +28 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: abort if NF set to negative valueDenys Vlasenko2018-11-281-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: remove duplicated codeRon Yorston2018-10-311-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At worst show_status_line() might be called needlessly when the user presses ^L/^R, but I don't think we'll get many complaints about that. function old new delta do_cmd 4592 4558 -34 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-34) Total: -34 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | vi: save a few bytesRon Yorston2018-11-261-14/+8
| |
* | Merge branch 'busybox' into mergeRon Yorston2018-10-081-12/+17
|\|
| * sed: fix double-free in FEATURE_CLEAN_UP codeDenys Vlasenko2018-09-251-12/+17
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox'Ron Yorston2018-07-252-27/+36
|\|
| * vi: placate "warning: variable orig_buf set but not used"Denys Vlasenko2018-06-271-25/+31
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: placate "warning: statement with no effect"Denys Vlasenko2018-06-271-1/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * restore documentation on the build config languageKartik Agaram2018-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | Kconfig-language.txt was deleted in commit 4fa499a17b52b back in 2006. Move to docs/ as suggested by Xabier Oneca: http://lists.busybox.net/pipermail/busybox/2014-May/080914.html Also update references to it everywhere. Signed-off-by: Kartik Agaram <akkartik@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-05-132-43/+89
|\|
| * awk: do not allow $(-1)Denys Vlasenko2018-04-231-0/+3
| | | | | | | | | | | | | | | | | | | | function old new delta EMSG_NEGATIVE_FIELD - 25 +25 evaluate 3390 3403 +13 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 38/0) Total: 38 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * patch: implement --dry-runDenys Vlasenko2018-04-141-43/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta static.patch_longopts - 137 +137 patch_main 2053 2135 +82 fail_hunk 132 139 +7 finish_oldfile 119 124 +5 packed_usage 32807 32787 -20 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/1 up/down: 231/-20) Total: 211 bytes 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-04-021-1/+1
|\|
| * sed: prevent overflow of length from bb_get_chunk_from_fileQuentin Rameau2018-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fragment did not work right: temp = bb_get_chunk_from_file(fp, &len); if (temp) { /* len > 0 here, it's ok to do temp[len-1] */ char c = temp[len-1]; With "int len" _sign-extending_, temp[len-1] can refer to a wrong location if len > 0x7fffffff. Signed-off-by: Quentin Rameau <quinq@fifth.space> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-02-131-27/+34
|\|
| * awk: code shrinkDenys Vlasenko2018-01-071-4/+3
| | | | | | | | | | | | | | function old new delta awk_main 955 948 -7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: fix 'delete array[var--]' decrementing var twiceDenys Vlasenko2018-01-071-23/+31
| | | | | | | | | | | | | | function old new delta evaluate 3395 3390 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-11-031-3/+3
|\|
| * use %m printf specifier where appropriateDenys Vlasenko2017-09-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta out 85 75 -10 udhcpd_main 1472 1461 -11 open_stdio_to_tty 98 85 -13 init_exec 245 232 -13 udhcpc_main 2763 2749 -14 do_cmd 4771 4755 -16 status_line_bold_errno 32 14 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-95) Total: -95 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-09-276-33/+30
|\|
| * regularize format of source file headers, no code changesDenys Vlasenko2017-09-186-19/+9
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>