New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] eval: Refactor eval.c #5119

Merged
merged 88 commits into from Mar 29, 2017

Conversation

Projects
None yet
9 participants
@ZyX-I
Contributor

ZyX-I commented Jul 26, 2016

Ref #5081.

@ZyX-I ZyX-I force-pushed the ZyX-I:split-eval branch from b4ebc64 to d640ef4 Jul 26, 2016

@ZyX-I ZyX-I force-pushed the ZyX-I:split-eval branch 2 times, most recently from 401f47a to 13f6129 Aug 20, 2016

@ZyX-I ZyX-I force-pushed the ZyX-I:split-eval branch 4 times, most recently from 0b71f49 to 25f9535 Aug 28, 2016

@ZyX-I

This comment has been minimized.

Contributor

ZyX-I commented Sep 4, 2016

This part should be mostly ready. Need to

  1. silence linter (376 new errors)
  2. add some unit tests

, but no more function moves in this PR.

@@ -199,7 +200,7 @@ add_custom_command(OUTPUT ${GENERATED_UNICODE_TABLES}
)
add_custom_command(OUTPUT ${GENERATED_API_DISPATCH} ${API_METADATA}
COMMAND ${LUA_PRG} ${DISPATCH_GENERATOR} ${PROJECT_SOURCE_DIR}/scripts ${API_HEADERS} ${GENERATED_API_DISPATCH} ${API_METADATA}
COMMAND ${LUA_PRG} ${DISPATCH_GENERATOR} ${API_SOURCE_DIR} ${API_HEADERS} ${GENERATED_API_DISPATCH} ${API_METADATA}

This comment has been minimized.

@bfredl

bfredl Sep 4, 2016

Member

Seems unnecessary to have a variable for every subdir, no? if we should follow the existing pattern
set(DEPRECATED_DISPATCH_FILE ${PROJECT_SOURCE_DIR}/src/nvim/api/deprecated_dispatch.lua but when thinking on it why not have set(NVIM_SOURCE_DIR ${PROJECT_SOURCE_DIR}/src/nvim) and then write ${NVIM_SOURCE_DIR}/api/deprecated_dispatch.lua, ${NVIM_SOURCE_DIR}/ex_cmds.lua etc in the build rules?

This comment has been minimized.

@ZyX-I

ZyX-I Sep 4, 2016

Contributor

I am wondering whether there is cmake variable which is like ${PROJECT_SOURCE_DIR}, but contains a directory where currently processed CMakeLists.txt lives. Such thing is better suited here.

This comment has been minimized.

@fwalch

fwalch Sep 4, 2016

Member

From http://www.cmake.org/Wiki/CMake_Useful_Variables:

CMAKE_CURRENT_LIST_DIR
(since 2.8.3) this is the directory of the listfile currently being processed.

@ZyX-I

This comment has been minimized.

Contributor

ZyX-I commented Sep 4, 2016

AppVeyor complains that

C:/projects/neovim/build/include/mbyte.h.generated.h:50:36: error: unknown type name 'WCHAR'
int utf8_to_utf16(const char _str, WCHAR *_strw) FUNC_ATTR_NONNULL_ALL;

, but I did not remove any headers from mbyte.h. Guess that there is some missing include in mbyte.h, where is this type defined on Windows (more precisely, what should I include, I see it defined in winnt.h in headers installed by mingw)?

@@ -74,6 +74,10 @@ run_oldtests() {
valgrind_check "${LOG_DIR}"
}
run_single_includes_tests() {
${MAKE_CMD} -C "${BULID_DIR}" check-single-includes

This comment has been minimized.

@fwalch

fwalch Sep 4, 2016

Member

Typo on BUILD_DIR.

This line should probably go into .ci/build.bat, too.

@@ -1,7 +0,0 @@
local helpers = require('test.unit.helpers')

This comment has been minimized.

@ZyX-I

ZyX-I Sep 4, 2016

Contributor

Not that this file should not exist, it should not exist in that commit.

@@ -19,4 +19,6 @@ run_oldtests
install_nvim
run_single_includes_test

This comment has been minimized.

@justinmk

justinmk Sep 4, 2016

Member

why does this come after install_nvim ? can it go before near build_nvim (line 10) to fail the build faster?

This comment has been minimized.

@ZyX-I

ZyX-I Sep 4, 2016

Contributor

When I was writing this I was not yet sure that if additional executables were built they will not be installed, so wrote test after install test. Though I now know that they are not installed and it should be possible to put this call there as well.

# Helper targets that verify that specific headers can be included alone (i.e.
# do not depend on other includes)
set(HEADER_CHECK_FILES)
set(NO_SINGLE_CHECK_HEADERS

This comment has been minimized.

@justinmk

justinmk Sep 5, 2016

Member

consider renaming this to HEADER_CHECK_SKIPPED for parallel form with HEADER_CHECK_TARGETS et al.

@ZyX-I ZyX-I force-pushed the ZyX-I:split-eval branch from 8108b53 to c2ccbca Sep 5, 2016

@ZyX-I

This comment has been minimized.

Contributor

ZyX-I commented Sep 10, 2016

It appears that single includes tests used to fail just because I have written singular in place of plural. Wondering why the printed result was that inadequate: out of “.ci/run_tests.sh: line 13: run_single_includes_test: command not found” (with different line though) only “mand not found” was left.

@ZyX-I

This comment has been minimized.

Contributor

ZyX-I commented Sep 11, 2016

Appveyor errors are something inadequate:

In file included from C:/Projects/neovim-1kmqj/src/nvim/mbyte.h:7:0,
                 from C:/Projects/neovim-1kmqj/src/nvim/eval/typval.h:10,
                 from C:\Projects\neovim-1kmqj\src\nvim\eval\decode.c:5:
C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:291:11: error: unknown type name 'CONST'
   typedef CONST WCHAR *LPCWCH,*PCWCH;
           ^

(and ten thousand lines of errors like this): looks like if winnt.h could not be directly included at all.

@jamessan

This comment has been minimized.

Member

jamessan commented Sep 11, 2016

looks like if winnt.h could not be directly included at all.

In my experience, Windows header's are pretty bad in terms of dependencies on other headers and include order. I'd suggest including Windows.h (which pulls in a lot of other relevant headers) and adding -DWIN32_LEAN_AND_MEAN to the preprocessor defines.

@ZyX-I ZyX-I force-pushed the ZyX-I:split-eval branch 2 times, most recently from 0119ca3 to a3205b1 Sep 14, 2016

@ZyX-I ZyX-I referenced this pull request Sep 17, 2016

Closed

Fix edge cases for NULL typval_T Lists #4615

30 of 30 tasks complete

@ZyX-I ZyX-I force-pushed the ZyX-I:split-eval branch from 8309142 to 1beda85 Sep 18, 2016

@ZyX-I

This comment has been minimized.

Contributor

ZyX-I commented Sep 18, 2016

Test linter has found an error which for some reason cannot be silenced by -- luacheck: ignore:

local function first_di(d)
  for _, di in dict_iter(d) do
    return di
  end
end

: error is “loop is executed at most once”. I can, of course, remove the syntax sugar behind for … in, but this code is cleaner.

@ZyX-I ZyX-I force-pushed the ZyX-I:split-eval branch from 4942e70 to 5935a7c Sep 23, 2016

@@ -204,14 +206,19 @@ add_custom_command(OUTPUT ${GENERATED_UNICODE_TABLES}
)
add_custom_command(OUTPUT ${GENERATED_API_DISPATCH} ${API_METADATA}
COMMAND ${LUA_PRG} ${DISPATCH_GENERATOR} ${CMAKE_CURRENT_LIST_DIR} ${API_HEADERS} ${GENERATED_API_DISPATCH} ${API_METADATA}
COMMAND ${LUA_PRG} ${DISPATCH_GENERATOR} ${CMAKE_CURRENT_LIST_DIR}/api ${API_HEADERS} ${GENERATED_API_DISPATCH} ${API_METADATA}

This comment has been minimized.

@bfredl

bfredl Sep 25, 2016

Member

Isn't it more consistent with just ${CMAKE_CURRENT_LIST_DIR}? just drop the changes to gendispatch.lua and it should work.

This comment has been minimized.

@ZyX-I

ZyX-I Sep 25, 2016

Contributor

Why should it know about which directory file is located in?

This comment has been minimized.

@bfredl

bfredl Sep 25, 2016

Member

it already knows the leaf filename, why not the entire path in the source directory? Someone reading gendispatch.lua (with the other scripts) would like to know where the file is, this is easier if it is consistent with other scripts and use nvimsrcdir, instead of libdir which doesn't say much. Also if some script later wants to use .lua files in several sub-directories the existing pattern is simpler.

@justinmk

This comment has been minimized.

Member

justinmk commented Mar 29, 2017

But what does mark_mb_adjustpos have to do with marks?

@ZyX-I

This comment has been minimized.

Contributor

ZyX-I commented Mar 29, 2017

pos_T is a mark position, so it is in mark.c. Any new void* types mean that I failed to find an easy way to fix problems with headers (i.e. header with function definition implicitly depends on another header, but if you just add it there you will find out that you are trying to add a cycle, which type was replaced with void * indicates which header I failed to include). Should be fixed far later, as a part of #6371. Any new moves are out of scope. I would rather omit triggering CI again by removing commits.

@ZyX-I

This comment has been minimized.

Contributor

ZyX-I commented Mar 29, 2017

Actually, mb_check_adjust_col should also be somewhere else. Guess, in cursor.c like function it references on the second line (docstring).

@ZyX-I

This comment has been minimized.

Contributor

ZyX-I commented Mar 29, 2017

And mb_adjust_cursor.

@justinmk

This comment has been minimized.

Member

justinmk commented Mar 29, 2017

It would be more intuitive if all of the position/cursor adjustment functions go in cursor.c. Regardless of where pos_T happens to come from.

@justinmk

This comment has been minimized.

Member

justinmk commented Mar 29, 2017

@oni-link any more comments?

@ZyX-I

This comment has been minimized.

Contributor

ZyX-I commented Mar 29, 2017

Would not say so. Cursor may be seen as a mark. But marks can’t be seen as cursors.

@oni-link

This comment has been minimized.

Contributor

oni-link commented Mar 29, 2017

@justinmk, not much time at the moment. I'm still stuck in typval.c reviewing, have not seen much else.

@justinmk

This comment has been minimized.

Member

justinmk commented Mar 29, 2017

@oni-link No problem, didn't want to merge this if you were still looking at it. Let's do it...

@justinmk justinmk merged commit c60e409 into neovim:master Mar 29, 2017

4 checks passed

QuickBuild Build pr-5119 finished with status SUCCESSFUL
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on master at 75.854%
Details

@justinmk justinmk removed the RFC label Mar 29, 2017

@@ -0,0 +1,10 @@
source-file=/home/zyx/a.a/Proj/c/neovim/src/nvim/move.c

This comment has been minimized.

@jamessan

jamessan Mar 29, 2017

Member

Should this file be here? :)

This comment has been minimized.

@ZyX-I

ZyX-I Mar 29, 2017

Contributor

Have no idea how it appeared, I definitely did not create it when playing with PVS-Studio.

This comment has been minimized.

@ZyX-I

ZyX-I Mar 29, 2017

Contributor

Especially how it appeared alone. I would understand if there was one cfg per .c file, could not possibly let that sneak in: too easy to see in git st even though I have a number of untracked files. But cfg for only one source file…

@ZyX-I ZyX-I deleted the ZyX-I:split-eval branch Mar 29, 2017

/// Get the number value of a VimL object
///
/// @note Use tv_get_number_chk() if you need to determine whether there was an
/// error.

This comment has been minimized.

@oni-link

oni-link Apr 13, 2017

Contributor

New way to return NULL?

This comment has been minimized.

@ZyX-I

ZyX-I Apr 13, 2017

Contributor

? There are no pointer returns here.

This comment has been minimized.

@oni-link

oni-link Apr 15, 2017

Contributor

Comment was somehow misplaced. See line 2490 on master:
https://github.com/neovim/neovim/blob/master/src/nvim/eval/typval.c#L2465-L2494

///
/// @return OK or FAIL.
int tv_list_concat(list_T *const l1, list_T *const l2, typval_T *const tv)
FUNC_ATTR_WARN_UNUSED_RESULT

This comment has been minimized.

@oni-link

oni-link Apr 16, 2017

Contributor

FUNC_ATTR_NONNULL_ARG(3)

typedef struct {
char_u *s;
char_u *tofree;

This comment has been minimized.

@oni-link

oni-link Apr 16, 2017

Contributor

Why is tofree needed? Can't we free with s too?

To optimize some strlen() calls out, we could save the length of s here too and later use ga_concat_len() instead of ga_concat() in list_join_inner().

tv_equal_recurse_limit = 1000;
}
if (recursive_cnt >= tv_equal_recurse_limit) {
tv_equal_recurse_limit--;

This comment has been minimized.

@oni-link

oni-link Apr 16, 2017

Contributor

The result of this function depends on the first call to it being made with recursive == false to set tv_equal_recurse_limit == 1000, otherwise unequal tvs could compare to true.
Could also happen later on if tv_equal_recurse_limit decreases to 0 and calls to this function are made with recursive == true.

/// @param[out] ret_error Location where 1 will be saved if index was not
/// found. May be NULL. If everything is OK,
/// `*ret_error` is not touched.
///

This comment has been minimized.

@oni-link

oni-link Apr 16, 2017

Contributor

Add comment like /// @note Needs to be initialized to false to be useful.?

/// found. May be NULL. If everything is OK,
/// `*ret_error` is not touched.
///
/// @return Integer value at the given index or -1.

This comment has been minimized.

@oni-link

oni-link Apr 16, 2017

Contributor

Could also be 0 if *ret_error == true

justinmk added a commit to justinmk/neovim that referenced this pull request May 1, 2017

NVIM v0.2.0
FEATURES:
    bc4a2e1 help, man.vim: "outline" (TOC) feature neovim#5169
    58422f1 'guicursor' works in the TUI (and sends info to UIs) neovim#6423
    129f107 api: nvim_get_mode() neovim#6247
    0b59f98 api/ui: externalize tabline neovim#6583
    bc6d868 'listchars': `Whitespace` highlight group neovim#6367
    6afa7d6 writefile() obeys 'fsync' option neovim#6427
    c60e409 eval.c refactor (also improves some error messages) neovim#5119
    9d200cd getcompletion("cmdline") neovim#6376
    2ea7bfc terminal: Support extra arguments in 'shell'. neovim#4504
    bf51102 DirChanged autocmd neovim#5928 neovim#6262
    1743df8 'cpoptions': "_" flag to toggle `cw` behaviour neovim#6235
    22337b1 CTRL-R omits trailing ^M when pasting to cmdline neovim#6137
    0e44916 :edit allows unescaped spaces in filename neovim#6119
    abdbfd2 eval: Add id() function and make printf("%p") useful neovim#6095
    bdfa147 findfile(), :find, gf work in :terminal. neovim#6009
    2f38ed1 providers: Disable if `g:loaded_*` exists.
    b5560a6 setpos() can set lowercase marks in other buffers neovim#5753
    7c513d6 Throttle :! output, pulse "..." message. neovim#5396
    d2e8c76 v:exiting neovim#5651

    :terminal improvements neovim#6185 neovim#6142
      - cursor keeps position after leaving insert-mode.
      - 4ceec30 Follows output only if cursor is at end of buffer.
      - e7bbd35 new option: 'scrollback'
      - fedb844 quasi-support for undo and 'modifiable'
      - b45ddf7 disables 'list' by default
      - disables 'relativenumber' by default

    :help now contains full API documentation at `:help api`.

    man.vim saw numerous improvements.

    Windows support:
      - Windows is no longer "experimental", it is fully supported.
      - Windows package includes a GUI, curl.exe and other utilities.

    "Vim 8" features: partials, lambdas, packages.

FIXES:
    12fc1de ops: fix i<c-r> with multi-byte text neovim#6524
    dd391bf Windows: system() and friends neovim#6497
    13352c0 Windows: os_get_hostname() neovim#6413
    16babc6 tui: Less-noisy mouse seqs neovim#6411
    3a9dd13 (vim bug) folding edge-cases  neovim#6207
    f6946c6 job-control: set CLOEXEC on pty processes. neovim#5986
    d1afd43 rplugin: Call s:LoadRemotePlugins() on startup.
    1215084 backtick-expansion works with `shell=fish` neovim#6224
    e32ec03 tui: Improved behavior after resize. neovim#6202
    86c2adc edit.c: CTRL-SPC: Insert previously-inserted text. neovim#6090
    c318d8e b:changedtick now follows VimL rules neovim#6112
    34e24cb terminal: Initialize colors in reverse order neovim#6160
    e889917 undo: Don't set b_u_curhead in ex_undojoin() neovim#5869
    d25649f undo: :earlier, g-: Set b_u_seq_cur correctly. (neovim#6016)
    043d8ba 'Visual-mode put from @. register' neovim#5782
    42c922b open_buffer(): Do `BufEnter` for directories.
    50d0d89 inccommand: Preview :sub commands only after delimiter neovim#5932
    1420e10 CheckHealth improvements neovim#5519
    c8d5e92 jobstart(): Return -1 if cmd is not executable. neovim#5671

CHANGES:
    NVIM_TUI_ENABLE_CURSOR_SHAPE was removed. Use 'guicursor' instead.
        See https://github.com/neovim/neovim/wiki/Following-HEAD#20170402

    81525dc 'mouse=a' is no longer the default. (This will probably
                 change again after it is improved.) neovim#6022

    0c1f783 defaults: 'showcmd', 'belloff', 'ruler' neovim#6087
    eb0e94f api: {get,set}_option update local options as appropriate neovim#6405
    bdcb2a3 "Reading from stdin..." message was removed. neovim#6298

@justinmk justinmk referenced this pull request May 1, 2017

Merged

NVIM v0.2.0 #6634

justinmk added a commit to justinmk/neovim that referenced this pull request May 1, 2017

NVIM v0.2.0
FEATURES:
    bc4a2e1 help, man.vim: "outline" (TOC) feature neovim#5169
    58422f1 'guicursor' works in the TUI (and sends info to UIs) neovim#6423
    129f107 api: nvim_get_mode() neovim#6247
    0b59f98 api/ui: externalize tabline neovim#6583
    bc6d868 'listchars': `Whitespace` highlight group neovim#6367
    6afa7d6 writefile() obeys 'fsync' option neovim#6427
    c60e409 eval.c refactor (also improves some error messages) neovim#5119
    9d200cd getcompletion("cmdline") neovim#6376
    2ea7bfc terminal: Support extra arguments in 'shell'. neovim#4504
    bf51102 DirChanged autocmd neovim#5928 neovim#6262
    1743df8 'cpoptions': "_" flag to toggle `cw` behaviour neovim#6235
    22337b1 CTRL-R omits trailing ^M when pasting to cmdline neovim#6137
    0e44916 :edit allows unescaped spaces in filename neovim#6119
    abdbfd2 eval: Add id() function and make printf("%p") useful neovim#6095
    bdfa147 findfile(), :find, gf work in :terminal. neovim#6009
    2f38ed1 providers: Disable if `g:loaded_*` exists.
    b5560a6 setpos() can set lowercase marks in other buffers neovim#5753
    7c513d6 Throttle :! output, pulse "..." message. neovim#5396
    d2e8c76 v:exiting neovim#5651

    :terminal improvements neovim#6185 neovim#6142
      - cursor keeps position after leaving insert-mode.
      - 4ceec30 Follows output only if cursor is at end of buffer.
      - e7bbd35 new option: 'scrollback'
      - fedb844 quasi-support for undo and 'modifiable'
      - b45ddf7 disables 'list' by default
      - disables 'relativenumber' by default

    :help now contains full API documentation at `:help api`.

    man.vim saw numerous improvements.

    Windows support:
      - Windows is no longer "experimental", it is fully supported.
      - Windows package includes a GUI, curl.exe and other utilities.

    "Vim 8" features: partials, lambdas.

SECURITY FIXES:
    CVE-2017-5953 CVE-2017-6349 CVE-2017-6350 neovim#6485

CHANGES:
    NVIM_TUI_ENABLE_CURSOR_SHAPE was removed. Use 'guicursor' instead.
        See https://github.com/neovim/neovim/wiki/Following-HEAD#20170402

    81525dc 'mouse=a' is no longer the default. (This will probably
                 change again after it is improved.) neovim#6022

    0c1f783 defaults: 'showcmd', 'belloff', 'ruler' neovim#6087
    eb0e94f api: {get,set}_option update local options as appropriate neovim#6405
    bdcb2a3 "Reading from stdin..." message was removed. neovim#6298

FIXES:
    12fc1de ops: fix i<c-r> with multi-byte text neovim#6524
    dd391bf Windows: system() and friends neovim#6497
    13352c0 Windows: os_get_hostname() neovim#6413
    16babc6 tui: Less-noisy mouse seqs neovim#6411
    3a9dd13 (vim bug) folding edge-cases  neovim#6207
    f6946c6 job-control: set CLOEXEC on pty processes. neovim#5986
    d1afd43 rplugin: Call s:LoadRemotePlugins() on startup.
    1215084 backtick-expansion works with `shell=fish` neovim#6224
    e32ec03 tui: Improved behavior after resize. neovim#6202
    86c2adc edit.c: CTRL-SPC: Insert previously-inserted text. neovim#6090
    c318d8e b:changedtick now follows VimL rules neovim#6112
    34e24cb terminal: Initialize colors in reverse order neovim#6160
    e889917 undo: Don't set b_u_curhead in ex_undojoin() neovim#5869
    d25649f undo: :earlier, g-: Set b_u_seq_cur correctly. (neovim#6016)
    043d8ba 'Visual-mode put from @. register' neovim#5782
    42c922b open_buffer(): Do `BufEnter` for directories.
    50d0d89 inccommand: Preview :sub commands only after delimiter neovim#5932
    1420e10 CheckHealth improvements neovim#5519
    c8d5e92 jobstart(): Return -1 if cmd is not executable. neovim#5671

justinmk added a commit to justinmk/neovim that referenced this pull request May 1, 2017

NVIM v0.2.0
FEATURES:
    bc4a2e1 help, man.vim: "outline" (TOC) feature neovim#5169
    58422f1 'guicursor' works in the TUI (and sends info to UIs) neovim#6423
    129f107 api: nvim_get_mode() neovim#6247
    0b59f98 api/ui: externalize tabline neovim#6583
    bc6d868 'listchars': `Whitespace` highlight group neovim#6367
    6afa7d6 writefile() obeys 'fsync' option neovim#6427
    c60e409 eval.c refactor (also improves some error messages) neovim#5119
    9d200cd getcompletion("cmdline") neovim#6376
    2ea7bfc terminal: Support extra arguments in 'shell'. neovim#4504
    bf51102 DirChanged autocmd neovim#5928 neovim#6262
    1743df8 'cpoptions': "_" flag to toggle `cw` behaviour neovim#6235
    22337b1 CTRL-R omits trailing ^M when pasting to cmdline neovim#6137
    0e44916 :edit allows unescaped spaces in filename neovim#6119
    abdbfd2 eval: Add id() function and make printf("%p") useful neovim#6095
    bdfa147 findfile(), :find, gf work in :terminal. neovim#6009
    2f38ed1 providers: Disable if `g:loaded_*` exists.
    b5560a6 setpos() can set lowercase marks in other buffers neovim#5753
    7c513d6 Throttle :! output, pulse "..." message. neovim#5396
    d2e8c76 v:exiting neovim#5651

    :terminal improvements neovim#6185 neovim#6142
      - cursor keeps position after leaving insert-mode.
      - 4ceec30 Follows output only if cursor is at end of buffer.
      - e7bbd35 new option: 'scrollback'
      - fedb844 quasi-support for undo and 'modifiable'
      - b45ddf7 disables 'list' by default
      - disables 'relativenumber' by default

    :help now contains full API documentation at `:help api`.

    man.vim saw numerous improvements.

    Windows support:
      - Windows is no longer "experimental", it is fully supported.
      - Windows package includes a GUI, curl.exe and other utilities.

    "Vim 8" features: partials, lambdas.

SECURITY FIXES:
    CVE-2017-5953 CVE-2017-6349 CVE-2017-6350 neovim#6485

CHANGES:
    NVIM_TUI_ENABLE_CURSOR_SHAPE was removed. Use 'guicursor' instead.
        See https://github.com/neovim/neovim/wiki/Following-HEAD#20170402

    81525dc 'mouse=a' is no longer the default. (This will probably
                 change again after it is improved.) neovim#6022

    0c1f783 defaults: 'showcmd', 'belloff', 'ruler' neovim#6087
    eb0e94f api: {get,set}_option update local options as appropriate neovim#6405
    bdcb2a3 "Reading from stdin..." message was removed. neovim#6298

FIXES:
    12fc1de ops: fix i<c-r> with multi-byte text neovim#6524
    dd391bf Windows: system() and friends neovim#6497
    13352c0 Windows: os_get_hostname() neovim#6413
    16babc6 tui: Less-noisy mouse seqs neovim#6411
    3a9dd13 (vim bug) folding edge-cases  neovim#6207
    f6946c6 job-control: set CLOEXEC on pty processes. neovim#5986
    d1afd43 rplugin: Call s:LoadRemotePlugins() on startup.
    1215084 backtick-expansion works with `shell=fish` neovim#6224
    e32ec03 tui: Improved behavior after resize. neovim#6202
    86c2adc edit.c: CTRL-SPC: Insert previously-inserted text. neovim#6090
    c318d8e b:changedtick now follows VimL rules neovim#6112
    34e24cb terminal: Initialize colors in reverse order neovim#6160
    e889917 undo: Don't set b_u_curhead in ex_undojoin() neovim#5869
    d25649f undo: :earlier, g-: Set b_u_seq_cur correctly. (neovim#6016)
    043d8ba 'Visual-mode put from @. register' neovim#5782
    42c922b open_buffer(): Do `BufEnter` for directories.
    50d0d89 inccommand: Preview :sub commands only after delimiter neovim#5932
    1420e10 CheckHealth improvements neovim#5519
    c8d5e92 jobstart(): Return -1 if cmd is not executable. neovim#5671

jamessan added a commit to jamessan/neovim that referenced this pull request May 3, 2017

Use vim_strchr(s, c) when c may be NUL
As part of the refactoring in neovim#5119, some vim_strchr() were changed to
strchr().  However, vim_strchr() behaves differently than strchr() when
c is NUL, returning NULL instead of a pointer to the NUL.

Revert the strchr() calls where it isn't known whether c is NUL, since
this causes a semantic change the surrounding code doesn't expect.  In
the case of neovim#6650, this led to a heap overrun.

Closes neovim#6650

justinmk added a commit that referenced this pull request May 3, 2017

Use vim_strchr(s, c) when c may be NUL (#6656)
As part of the refactoring in #5119, some vim_strchr() were changed to
strchr().  However, vim_strchr() behaves differently than strchr() when
c is NUL, returning NULL instead of a pointer to the NUL.

Revert the strchr() calls where it isn't known whether c is NUL, since
this causes a semantic change the surrounding code doesn't expect.  In
the case of #6650, this led to a heap overrun.

Closes #6650
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment