aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
Commit message (Collapse)AuthorAge
...
* | win: Fix reading content from stdin (#8267)b-r-o-c-k2018-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #6890 by reading from the Windows console input buffer after stdin has been closed. Vim defines HAVE_DUP for Windows and does the close-dup dance[1]: close(0); dup(2); which always fails, then falls back to reading from the Windows console input buffer[2]. [1] https://github.com/vim/vim/blob/e7499ddc33508d3d341e96f84a0e7b95b2d6927c/src/fileio.c#L2397-L2398 [2] https://github.com/vim/vim/blob/e7499ddc33508d3d341e96f84a0e7b95b2d6927c/src/os_win32.c#L1703-L1714
* | Make vim_fgets() return the same values as in VimMarco Hinz2018-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of vim_fgets() differs between Neovim and Vim. Vim says that it only returns `true` for EOF. But it always returns `true` when fgets() returns NULL. This happens for EOF _or_ errors. That probably misguided the author of Neovim's vim_fgets(), which does NOT return `true` for errors. Since all the callers of vim_fgets() probably expect it to work as it does in Vim (and not as it says), it now returns the same values as the Vim implementation. Fixes #8227
* | vim-patch:8.0.1284: loading file type detection slows down startupJustin M. Keyes2018-04-02
|/ | | | | | | Problem: Loading file type detection slows down startup. Solution: Store the last pattern of an autocommand event to make appending quicker. https://github.com/vim/vim/commit/462455ee8b81cb5709007d91248ac4a88308d6e9
* refactor/rename: path_is_absolute()Justin M. Keyes2018-03-24
|
* refactor: eliminate `autocmd_fname_full` globalJustin M. Keyes2018-03-24
| | | | | | | | It's a micro-optimization; check path_is_absolute_path(autocmd_fname) instead. The main optimization (which is still in place) afforded by Vim 7.2.021 was to avoid resolving <afile> when it is not needed.
* provider/RPC: apply_autocmds_group(): fix double-freeJustin M. Keyes2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During provider dispatch, eval_call_provider() saves global state--including pointers, such as `autocmd_fname`--into `provider_caller_scope` which is later restored by f_rpcrequest(). But `autocmd_fname` is special-cased in eval_vars(), for performance (see Vim patch 7.2.021; this is also the singular purpose of the `autocmd_fname_full` global. Yay!) If eval_vars() frees `autocmd_fname` then its provider-RPC-scoped alias becomes a problem. Solution: Don't free autocmd_fname in eval_vars(), just copy into it. closes #5245 closes #5617 Reference ------------------------------------------------------------------------ Vim patch 7.2.021 https://github.com/vim/vim/commit/f6dad43c98f47da1ff9d8c99b320fc3674f83c63 Problem: When executing autocommands getting the full file name may be slow. (David Kotchan) Solution: Postpone calling FullName_save() until autocmd_fname is used. vim_dev discussion (2008): "Problem with CursorMoved AutoCommand when Editing Files on a Remote WIndows Share" https://groups.google.com/d/msg/vim_dev/kj95weZa_eE/GTgj4aq5sIgJ
* lintJustin M. Keyes2018-02-11
|
* vim-patch:8.0.0703: illegal memory access with empty :doau commandJustin M. Keyes2018-02-11
| | | | | | | Problem: Illegal memory access with empty :doau command. Solution: Check the event for being out of range. (James McCoy) https://github.com/vim/vim/commit/faf29d7f91477c25c85d9d7165d90e8d8f1c512e
* vim-patch:8.0.0448: some macros are lower case (#7936)KunMing Xie2018-01-30
| | | | | | | Problem: Some macros are in lower case, which can be confusing. Solution: Make a few lower case macros upper case. https://github.com/vim/vim/commit/b5aedf3e228d35821591da9ae8501b61cf2e264c ref #6297
* io: fix handling EOF in vim_fgetsMatt Widmann2017-11-25
| | | | | | | | | If an EOF is returned from `fgets`, `vim_fgets` might spin forever, as it tries to consume the current line. A `NULL` return value from `fgets` should break out of the function (unless `errno` is `EINTR`), and then `feof` should be used to check for the EOF condition on the stream.
* io: retry fgets on EINTR (#7632)Matt Widmann2017-11-25
| | | | | | | | | | | | | | | | | | The calls to `fgets` in `src/nvim/if_cscope.c` (and elsewhere) can show communication errors to the user if a signal is delivered during its system calls. For plugins that proxy subprocess output into cscope requests, a `SIGCHLD` might *always* interfere with calls into `fgets`. To see this in a debugger, put a breakpoint on `cs_reading_emsg` and watch signals come in (with lldb, using `process handle --notify true --pass true`). Next, run a subcommand from neovim that calls through cscope when it returns. A tag picker plugin, like vim-picker and fzy, with `cscopetag` and `cscopetagorder=0` set, reproduced this reliably. The breakpoint will hit after a `SIGCHLD` is delivered, and `errno` will be set to 4, `EINTR`. The caller of `fgets` should retry when `NULL` is returned with `errno` set to `EINTR`.
* vim-patch:8.0.0227 (#7548)Justin M. Keyes2017-11-13
| | | | | | | Problem: Crash when 'fileformat' is forced to "dos" and the first line in the file is empty and does not have a CR character. Solution: Don't check for CR before the start of the buffer. https://github.com/vim/vim/commit/2aa5f696b91a51f29873e340de4bdc182e1e8dd4
* Merge #7530 'vim-patch:8.0.0226 vim-patch:8.0.0224'Justin M. Keyes2017-11-13
|\
| * fix lint errorckelsel2017-11-11
| |
| * vim-patch:8.0.0224ckelsel2017-11-10
|/ | | | | | | | | Problem: When 'fileformats' is changed in a BufReadPre auto command, it does not take effect in readfile(). (Gary Johnson) Solution: Check the value of 'fileformats' after executing auto commands. (Christian Brabandt) https://github.com/vim/vim/commit/7a2699e868bca781e26b060a44fc714d87cfa4ba
* buf_write(): handle NULL fname on non-unixJustin M. Keyes2017-08-10
|
* buf_write(): wrong argument to os_fileinfo_hardlinksJustin M. Keyes2017-08-09
| | | | | | | This was broken in ye olde refactor from 2014: e85fe0957d40080f43cbfcbe9eb8864475325b09 References #4370
* lintckelsel2017-07-13
|
* vim-patch:7.4.2229ckelsel2017-07-13
| | | | | | | | | | | https://github.com/vim/vim/commit/f04507d132fbcb63999167ec006fc6e700b5af4f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 20 15:05:39 2016 +0200 patch 7.4.2229 Problem: Startup test fails on Solaris. Solution: Recognize a character device. (Danek Duvall)
* vim-patch:7.4.2189ckelsel2017-07-13
| | | | | | | | | | | | https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 9 22:14:05 2016 +0200 patch 7.4.2189 Problem: Cannot detect encoding in a fifo. Solution: Extend the stdin way of detecting encoding to fifo. Add a test for detecting encoding on stdin and fifo. (Ken Takata)
* lintJames McCoy2017-06-04
|
* vim-patch:7.4.1976James McCoy2017-06-04
| | | | | | | Problem: Number variables are not 64 bits while they could be. Solution: Add the num64 feature. (Ken Takata) https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
* vim-patch:7.4.1975James McCoy2017-06-04
| | | | | | | | | | | Problem: On MS-Windows large files (> 2Gbyte) cause problems. Solution: Use "off_T" instead of "off_t". Use "stat_T" instead of "struct stat". Use 64 bit system functions if available. (Ken Takata) https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe Only the off_T changes are relevant, since all the "struct stat" usage is abstracted by libuv.
* doc: bracketed-paste-modeJustin M. Keyes2017-05-01
|
* *: Add comment to all C filesZyX2017-04-19
|
* fileio: Simlify help files encoding detectionZyX2017-04-16
| | | | Most of code is dead when enc_utf8 is always true. Given that `c` is being reused for other purposes I left it set to 1 just in case.
* fileio: Fix most linter errorsZyX2017-04-03
| | | One error is still kept: buf_write function is too large.
* fileio: Save details about E212 errorZyX2017-04-03
|
* fileio: Refactor msg_add_fname to something which needs no commentsZyX2017-04-03
|
* fileio: Clean up IObuff-manipulation messZyX2017-04-03
|
* fileio: Refactor errmsg handlingZyX2017-04-03
| | | | | | | | Adds os_strerror() result to a number of places. Also since I could not track where err\* variables are NULL and where they are not, using macros to make sure that all three variables are set at once. Removes #ifdef UNIX around the use of os_fsync, makes it use os_close in place of close in some places.
* *: Fix some Windows-specific warningsZyX2017-03-29
| | | | Also fixed an error in path_fnamecmp().
* eval: Move remaining get_tv_string* functions to eval/typval.cZyX2017-03-29
|
* eval,*: Move get_tv_string to typval.cZyX2017-03-29
| | | | Function was renamed and changed to return `const char *`.
* vim-patch:8.0.0486Justin M. Keyes2017-03-22
| | | | | | | | | | Problem: Crash and endless loop when closing windows in a SessionLoadPost autocommand. Solution: Check for valid tabpage. (partly neovim/neovim#6308) https://github.com/vim/vim/commit/8c752bd6c4af54c0b7bac35a39acc2bf16015f85 Closes #6308
* readfile(): Remove "Reading from stdin..." #6298Vadim A. Misbakh-Soloviov2017-03-18
|
* job-control: set CLOEXEC on pty processes. #5986Matthew Malcomson2017-03-17
| | | | | Before this change, new processes started with libuv prevented SIGHUP from reaching pty processes (by keeping the ptmx file descriptor open).
* lintJames McCoy2017-03-11
|
* vim-patch:7.4.2101James McCoy2017-03-11
| | | | | | | Problem: Looping over windows, buffers and tab pages is inconsistant. Solution: Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/2932359000b2f918d5fade79ea4d124d5943cd07
* *: Fix linter errorsZyX2017-02-15
|
* *: Partial string handling refactoringZyX2017-02-15
| | | | | | | | Main points: - Replace `char_u` with `char` in some cases. - Remove `str[len] = NUL` hack in some cases when `str` may be considered `const`.
* Fix clint issuesMarco Hinz2017-02-04
|
* vim-patch:7.4.2024Marco Hinz2017-02-04
| | | | | | | | | | Problem: More buf_valid() calls can be optimized. Solution: Use bufref_valid() instead. NOTE: Some changes related to channels and the Python and Netbeans interfaces were obviously left out. https://github.com/vim/vim/commit/7c0a2f367f2507669560b1a66423155c70d2e75b
* coverity/155512: Pass correct length to strncat()Justin M. Keyes2017-01-23
| | | | References 8bc2bffda94bf2de4e8adae57b4b5597ed4e8247
* coverity/155512: Pass correct length to strncat()ZyX2017-01-23
|
* readfile(): Fix read-after-free.Justin M. Keyes2017-01-21
| | | | | | References https://github.com/neovim/neovim/pull/5956#pullrequestreview-17812620 Helped-by: oni-link <knil.ino@gmail.com>
* Merge #5928 'New event: DirChanged'Marco Hinz2017-01-16
|\
| * Don't expand filenames during autocmdMarco Hinz2017-01-13
| |
* | readfile(): Avoid file message when reading from stdin. #5956Michael Schupikov2017-01-16
| | | | | | | | Closes #5921
* | Merge #5918 'vim-patch: 7.4.2006, 7.4.2075, 7.4.2077, 7.4.2117, 7.4.2300, ↵Justin M. Keyes2017-01-16
|\ \ | |/ |/| | | 7.4.2313, 7.4.2314'.