aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
Commit message (Collapse)AuthorAge
...
| * mbyte: Fix crash when using multibyte chars in maparg() return (#6986)Nikolai Aleksandrovich Pavlov2017-07-09
| | | | | | | | | | | | | | | | This is a refactoring typo from #6947. Fixes #6985 Combined with #6947 where typo was made it also fixes vim/vim#1827 which was present in Neovim.
| * mbyte: Refactor mb_unescapeZyX2017-07-02
| | | | | | | | Does not alter its usages.
* | ex_getln: Add some more tests, fix some found errorsZyX2017-06-27
|/
* Merge #6460 from ZyX-I/1476-changesJustin M. Keyes2017-05-08
|\ | | | | Refactor functions which find character in a string
| * Merge branch 'master' into 1476-changesZyX2017-04-10
| |\
| * | strings: Remove vim_strbyteZyX2017-04-07
| | | | | | | | | | | | Ref #1476
* | | utf16_to_utf8: Allocate space for converted string and NULJames McCoy2017-05-03
| | | | | | | | | | | | References #6646
* | | *: Add comment to all C filesZyX2017-04-19
| |/ |/|
* | lint: fix clint errors around mb_tolower callsBjörn Linse2017-04-10
| |
* | mbyte: replace vim_tolower with mb_tolower handling locale correctlyBjörn Linse2017-04-10
| |
* | win: os_get_hostname() #5416 (#6413)Justin M. Keyes2017-04-07
|/
* eval: Move remaining get_tv_string* functions to eval/typval.cZyX2017-03-29
|
* *: Move some dictionary functions to typval.h and use char*ZyX2017-03-29
| | | | Also fixes buffer reusage in setmatches() and complete().
* eval: Split eval.c into smaller filesZyX2017-03-29
|
* mbyte: remove dead codeBjörn Linse2017-03-22
|
* terminal: Avoid invalid cursor col (#6265)Justin M. Keyes2017-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch-by: oni-link <knil.ino@gmail.com> Closes #6203 https://s3.amazonaws.com/archive.travis-ci.org/jobs/206794197/log.txt References #3161 [ RUN ] ...d/neovim/neovim/test/functional/terminal/buffer_spec.lua @ 199: terminal buffer term_close() use-after-free #4393 ./test/functional/helpers.lua:187: attempt to perform arithmetic on local 'written' (a nil value) stack traceback: ./test/functional/helpers.lua:187: in function 'nvim_feed' ./test/functional/helpers.lua:329: in function 'execute' ...d/neovim/neovim/test/functional/terminal/buffer_spec.lua:206: in function <...d/neovim/neovim/test/functional/terminal/buffer_spec.lua:199> [ ERROR ] ...d/neovim/neovim/test/functional/terminal/buffer_spec.lua @ 199: terminal buffer term_close() use-after-free #4393 (199.47 ms) ==================== File /home/travis/build/neovim/neovim/build/log/ubsan.15466 ==================== = ================================================================= = ==15466==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x621000029101 at pc 0x000000ea7ba0 bp 0x7ffd5bb628c0 sp 0x7ffd5bb628b8 = READ of size 1 at 0x621000029101 thread T0 = #0 0xea7b9f in utf_head_off /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1637:7 = #1 0xeaaf53 in mb_adjustpos /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1840:16 = #2 0xeaab48 in mb_adjust_cursor /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1825:3 = #3 0x11000d0 in normal_finish_command /home/travis/build/neovim/neovim/src/nvim/normal.c:928:5 = #4 0x1077df1 in normal_execute /home/travis/build/neovim/neovim/src/nvim/normal.c:1147:3 = #5 0x16ff943 in state_enter /home/travis/build/neovim/neovim/src/nvim/state.c:58:26 = #6 0x102d8db in normal_enter /home/travis/build/neovim/neovim/src/nvim/normal.c:463:3 = #7 0xdf3398 in main /home/travis/build/neovim/neovim/src/nvim/main.c:540:3 = #8 0x2b973e8b4f44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287 = #9 0x447445 in _start (/home/travis/build/neovim/neovim/build/bin/nvim+0x447445) = = 0x621000029101 is located 1 bytes to the right of 4096-byte region [0x621000028100,0x621000029100) = allocated by thread T0 here: = #0 0x4f17b8 in malloc (/home/travis/build/neovim/neovim/build/bin/nvim+0x4f17b8) = #1 0xf1f374 in try_malloc /home/travis/build/neovim/neovim/src/nvim/memory.c:84:15 = #2 0xf1f534 in xmalloc /home/travis/build/neovim/neovim/src/nvim/memory.c:118:15 = #3 0xebe6a8 in mf_alloc_bhdr /home/travis/build/neovim/neovim/src/nvim/memfile.c:646:17 = #4 0xebc394 in mf_new /home/travis/build/neovim/neovim/src/nvim/memfile.c:297:12 = #5 0xed1368 in ml_new_data /home/travis/build/neovim/neovim/src/nvim/memline.c:2704:16 = #6 0xece6ab in ml_open /home/travis/build/neovim/neovim/src/nvim/memline.c:349:8 = #7 0x6438ad in open_buffer /home/travis/build/neovim/neovim/src/nvim/buffer.c:109:7 = #8 0xa6ec8d in do_ecmd /home/travis/build/neovim/neovim/src/nvim/ex_cmds.c:2489:24 = #9 0xb5a0f9 in do_exedit /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:6723:9 = #10 0xb791f8 in ex_edit /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:6651:3 = #11 0xb28b43 in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2198:5 = #12 0xb077a7 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:601:20 = #13 0x10905db in nv_colon /home/travis/build/neovim/neovim/src/nvim/normal.c:4495:18 = #14 0x1077de8 in normal_execute /home/travis/build/neovim/neovim/src/nvim/normal.c:1144:3 = #15 0x16ff943 in state_enter /home/travis/build/neovim/neovim/src/nvim/state.c:58:26 = #16 0x102d8db in normal_enter /home/travis/build/neovim/neovim/src/nvim/normal.c:463:3 = #17 0xdf3398 in main /home/travis/build/neovim/neovim/src/nvim/main.c:540:3 = #18 0x2b973e8b4f44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287 = = SUMMARY: AddressSanitizer: heap-buffer-overflow /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1637:7 in utf_head_off stack traceback: ./test/helpers.lua:80: in function 'check_logs' ./test/functional/helpers.lua:639: in function <./test/functional/helpers.lua:638> [----------] 9 tests from /home/travis/build/neovim/neovim/test/functional/terminal/buffer_spec.lua (2263.12 ms total)
* refactor: fix warningsJustin M. Keyes2017-02-04
|
* win: fix warningsJustin M. Keyes2017-01-19
|
* vim-patch:7.4.2028rover2017-01-01
| | | | | | | Problem: cppcheck warns for using index before limits check. Solution: Swap the expressions. (Dominique Pelle) https://github.com/vim/vim/commit/5498a41f5a62c3877fee0185adf3bf7245a9a547
* vim-patch:7.4.2019rover2017-01-01
| | | | | | | Problem: When ignoring case utf_fold() may consume a lot of time. Solution: Optimize for ASCII. https://github.com/vim/vim/commit/c4a927ca8dc383190d5df2cacd3f966698b6190c
* Move utf8len_tab definition to globals.hJames McCoy2016-11-23
| | | | | | | | | | | | | The existing code would cause utf8len_tab to be declared as non-extern when main.cpp included globals.h as well as in mbyte.c. This causes the following warning Linking C executable ../../bin/nvim /usr/bin/ld: Warning: size of symbol `utf8len_tab' changed from 256 in CMakeFiles/nvim.dir/main.c.o to 320 in CMakeFiles/nvim.dir/mbyte.c.o Moving the definition to globals.h and using INIT() ensures the array is only defined in main.cpp and other places globals.h is included see an extern declaration.
* encoding: delete non-UTF-8 implementations of multibyte functionsBjörn Linse2016-11-05
| | | | Deleted documentation was duplicated at specific utf_ implementation
* encoding: cleanup mbyte.c given fixed encoding=utf-8Björn Linse2016-11-05
| | | | | | | | | Eliminate mb_init(): Set "enc_utf" and "has_mbyte" early. Eliminate "enc_unicode" and "enc_latin1like". init_chartab() and screenalloc() are already invoked elsewhere in the initialization process. The EncodingChanged autocmd cannot be triggered. At initialization, there is no spellfiles to reload
* ui: Fix the call to utf_ambiguous_widthJames McCoy2016-10-11
| | | | | | | | | | | | | | | `utf_ambiguous_width` expects the Unicode character, but in 9e1c6596 I just passed the first UTF-8 byte to the function. This led to various display problems because now many multi-cell characters weren't falling into that part of the branch. Also, to better align with the existing Vim code, remove the forced cursor update. Setting the flag will cause it to happen in the next UI_CALL. Thanks to qvacua for all the help investigating the issue! Closes #5448
* vim-patch:7.4.1697James McCoy2016-09-24
| | | | | | | | | Problem: Display problems when the 'ambiwidth' and 'emoji' options are not set properly or the terminal doesn't behave as expected. Solution: After drawing an ambiguous width character always position the cursor. https://github.com/vim/vim/commit/cb0700844c1274fe8bc0ceaffaee0ad21c406f30
* vim-patch:7.4.1629James McCoy2016-09-24
| | | | | | | | | | Problem: Handling emoji characters as full width has problems with backwards compatibility. Solution: Remove ambiguous and double width characters from the emoji table. Use a separate table for the character class. (partly by Yashuhiro Matsumoto) https://github.com/vim/vim/commit/b86f10ee10bdf932df02bdaf601dffa671518a47
* vim-patch:7.4.1620James McCoy2016-09-24
| | | | | | | Problem: Emoji characters are not considered as a kind of word character. Solution: Give emoji characters a word class number. (Yashuhiro Matsumoto) https://github.com/vim/vim/commit/4077b33a8370afb3d5ae74e556a0119cf51fe294
* vim-patch:7.4.1604James McCoy2016-09-24
| | | | | | | | | Problem: Although emoji characters are ambiguous width, best is to treat them as full width. Solution: Update the Unicode character tables. Add the 'emoji' options. (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/3848e00e0177abdb31bc600234967863ec487233
* refactor: eliminate misc2.cJustin M. Keyes2016-09-13
| | | | | | | | | | move `call_shell` to misc1.c Move some fns to state.c Move some fns to option.c Move some fns to memline.c Move `vim_chdir*` fns to file_search.c Move some fns to new module, bytes.c Move some fns to fileio.c
* mbyte.c: Move utf8/utf16 functions to mbyte.cJustin M. Keyes2016-07-30
|
* *: Fix errors from new linter checksZyX2016-06-11
|
* mbyte.c: Fix invalid memory access in utfc_ptr2char_lenoni-link2016-04-15
| | | | | | To get an UTF-8 character, utf_ptr2char() is used. But this function can read more than maxlen bytes, if an incomplete byte sequence is used(first byte specifies a length > maxlen).
* build: install *.mo into the "standard" directoryJun T2016-02-23
| | | | | | | Change POROJECT_NAME to 'nvim', and use it as the gettext domain name. The *.mo files, previously installed as $runtime/lang/xx/LC_MESSAGES/nvim.mo, are now installed as $prefix/locale/xx/LC_MESSAGES/nvim.mo.
* encoding: cleanup defaults of iskeyword, isprint and fileencodingsBjörn Linse2016-01-02
|
* encoding: Always use "utf-8" as default for &encodingBjörn Linse2016-01-02
| | | | Preverve the locale-depedency for fileencodings=default
* src/*: Remove `VIM - Vi improved ...` headerMichael Reed2015-11-27
| | | | | | | | | | | | | | | | | | | Regarding the individual items in the header: `Vim - Vi improved by Bram Moolenar` Bram Moolenar is already mentioned throughout the documentation, as well as the intro screen. `:help uganda` It's already shown to all users who don't use `shortmess+=I` upon starting nvim, and is already placed prominently in help.txt, i.e., `:help` run with no arguments. `:help credits` Already mentioned near the top of help.txt. `README.md` Already mentioned in develop.txt.
* Remove unnecessary includes for errno.hRui Abreu Ferreira2015-11-25
|
* src: README.txt -> README.mdMichael Reed2015-11-23
| | | | | The former no longer exists in this repo; see the top of src/nvim/README.md.
* viminfo: First version of ShaDa file dumpingZyX2015-10-08
| | | | | | | | | | | | | | | | | | | | What works: 1. ShaDa file dumping: header, registers, jump list, history, search patterns, substitute strings, variables. 2. ShaDa file reading: registers, global marks, variables. Most was not tested. TODO: 1. Merging. 2. Reading history, local marks, jump and buffer lists. 3. Documentation update. 4. Converting some data from &encoding. 5. Safer variant of dumping viminfo (dump to temporary file then rename). 6. Removing old viminfo code (currently masked with `#if 0` in a ShaDa file for reference).
* Generate unicode tables with script when buildingZyX2015-07-26
|
* vim-patch:7.4.575 #2835Felipe Morales2015-06-17
| | | | | | | | | | ``` updated for version 7.4.575 Problem: Unicode character properties are outdated. Solution: Update the tables with the latest version. ``` https://code.google.com/p/vim/source/detail?r=v7-4-575
* Passing by: Remove X_LOCALE refsMichael Reed2015-05-30
| | | | We don't link to any X11 libs, so this is most likely unneeded.
* getenv: return NULL if empty #2574Scott Prager2015-05-29
| | | | | | Making an environment variable empty can be a way of unsetting it for platforms that don't support unsetenv(). In most cases, we treat empty variables as having been unset. For all others, use os_env_exists().
* options: mark nonfunctional &termencoding option as hidden. #2631Björn Linse2015-05-17
| | | | | | | Remove related dead code and references in the docs. Helped-By: Michael Reed <m.reed@mykolab.com> Helped-By: Shougo Matsushita <Shougo.Matsu@gmail.com>
* Replace vim_iswhite with ascii_iswhite() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* memory: Add `free` wrapper and refactor project to use itThiago de Arruda2015-04-13
| | | | | | We already use wrappers for allocation, the new `xfree` function is the equivalent for deallocation and provides a way to fully replace the malloc implementation used by Neovim.
* Remove redundant castsAnton Ovchinnikov2015-03-09
|
* Enable -Wconversion: mark.c.Eliseo Martínez2015-02-18
| | | | | | Refactoring summary: - MB_STRNICMP: Inlined. - MB_STRNCMP: Inlined.
* Enable -Wconversion: Passing-by: Remove dead code (MACOS_CONVERT).Eliseo Martínez2015-02-18
| | | | MacOS (pre Mac OS X) is not supported anymore.
* Enable -Wconversion: ui.c.Eliseo Martínez2015-02-18
| | | | | | | | | | | | | | | Refactoring summary: - ui_write(): len: int --> size_t * parse_abstract_ui_codes(): len: int --> size_t * string_convert(): lenp: int * --> size_t * - string_convert_ext(): lenp : int * --> size_t * unconvlenp: int * --> size_t * * utf8len_tab_zero: char[] --> uint8_t[] * iconv_string(): slen : int --> size_t unconvlenp: int * --> size_t * resultlenp: int * --> size_t * - mch_print_text_out(): len: int --> size_t * out_pos: int --> size_t