Closes#731
References #851
Note: This does not remove some intentional legacy usages of strncpy.
- memcpy isn't equivalent because it doesn't check the string
length of `src`, and doesn't zero-out the remainder of `dst`.
- xstrlcpy isn't equivalent because it doesn't zero-out the
remainder of `dst`. Some Vim logic depends on that (e.g.
ex_append which calls vim_strnsave).
Helped-by: Douglas Schneider <ds3@ualberta.ca>
Helped-by: oni-link <knil.ino@gmail.com>
Helped-by: James McCoy <jamessan@jamessan.com>
Problem: Command line completion on "find **/filename" drops sub-directory.
Solution: Handle this case separately. (Harm te Hennepe, closesvim/vim#932, closes
vim/vim#939)
73d4e4c892
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
Reported in #4955, get_past_head() is supposed to return a pointer
after the head of the path (/ in UNIX, c:\ in Windows) but the windows
case was removed.
Removed the Mac reference in the comment, since there no special
handling for Mac.
vim-patch:0
Per #2471, some path handling functions hardcode the UNIX path
separator '/' causing them to fail in Windows.
When BLACKSLASH_IN_FILENAME is set we may have to check against
psepc and psepcN instead of PATHSEP or use vim_ispathsep_nocolon().
Problem: Editing a URL, which netrw should handle, doesn't work.
Solution: Avoid changing slashes to backslashes. (Yasuhiro Matsumoto)
b4f6a46b01
Cherry-picked from https://github.com/neovim/neovim/pull/810, rebased.
Problem: When completing a shell command, directories in the current
directory are not listed.
Solution: When "." is not in $PATH also look in the current directory for
directories.
b5971141df
Most of it applied manually.
Problem: Vim leaks memory, when 'wildignore' filters out all matches.
Solution: Free the files array when it becomes empty.
7b256fe744
The only nontrivial part of 7.4.871 missing (renamings of variables are in
another commit; freeing *files after 0 matches was already there, just FAIL was
not returned in that case)
Problem: MS-Windows: When 'encoding' differs from the current code page,
expandinig wildcards may cause illegal memory access.
Solution: Allocate a longer buffer. (Ken Takata)
7314efd87d
Problem: When expanding `=expr` on the command line and encountering an
error, the command is executed anyway.
Solution: Bail out when an error is detected.
3f188935ec