Commit Graph

179 Commits

Author SHA1 Message Date
Jurica Bradaric
e8dd996703 vim-patch:7.4.835
Problem:    Comparing utf-8 sequences does not handle different byte sizes
            correctly.
Solution:   Get the byte size of each character. (Dominique Pelle)

f6470c288c
2016-02-09 23:08:24 +01:00
Justin Gassner
299044d4ef vim-patch:7.4.656
Problem:    Missing changes for glob() in one file.
Solution:   Add the missing changes.

d8b77f7dc0
2016-01-25 21:45:26 +01:00
Seth Jackson
a7ade5c832 misc: UNIX => Unix #4022
Although UNIX is a registered trademark of The Open Group, it doesn't
really matter whether we refer to these systems as UNIX, Unix, or
Unix-like. So, for consistency, refer to them collectively as Unix.

Related:
http://www.greens.org/about/unix.html
http://www.unixica.com/html/unixunix.html
2016-01-16 18:34:31 -05:00
Rui Abreu Ferreira
57cfb95758 win32: Fix syntax error in #ifndef block. #3968
The block is only compiled if the system is NOT WIN32, but the closing
parenthesis for the statement opened outside the block is closed inside
the block.
2016-01-10 01:38:09 -05:00
Rui Abreu Ferreira
568ee1e3c2 Windows: Ignore EW_ICASE in do_path_expand
The do_path_expand() function is still using the unix_expandpath
variant from Vim. For Windows it should behave as the old
dos_expandpath() function. This commit adds an ifdef to ignore
EW_ICASE flag in this function, otherwise all matches fail on Windows
if wildignorecase is set.
2015-12-31 16:14:12 -05:00
Rui Abreu Ferreira
fe143ac439 Windows: Remove UNIX guard for pstrcmp()
@equalsraf: I took a look at the Vim source pstrcmp() is actually used in the
dos_expandpath(misc1.c). The only difference between the UNIX and WIN32 version
of the functions is the _cdecl call convention annotation - the body of the
function is identical. Neovim kept the comment from the Unix function but not
from the Windows variant. Seems to me its safe to use the same function for
both - and just correct the comment.
2015-12-11 19:10:06 -05:00
Michael Reed
53ee6425c8 src/*: Remove VIM - Vi improved ... header
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.
2015-11-27 16:25:10 -05:00
Rui Abreu Ferreira
4f24b9e06f Remove unnecessary includes for errno.h 2015-11-25 16:38:33 -05:00
ZyX
ca6235c20f *: Fix linter errors 2015-10-23 15:56:50 +03:00
ZyX
a1b0f4073d stdpaths: Do NOT create data directories
This is none of option.c business to create *possibly unneeded* **default**
directories **before** user specified where he actually wants to place the
files.
2015-10-23 14:54:10 +03:00
ZyX
502a20a8fe stdpaths,main: Remove all remaining memory leaks 2015-10-23 14:54:10 +03:00
Rui Abreu Ferreira
e70d6283b6 Remove VLA from path_get_absolute_path
Remove the use of Variable Length Arrays in path_get_absolute_path(), and use
xmalloc/xfree instead.
2015-09-24 16:50:33 +01:00
Thiago de Arruda
c708061a5a os/path: Fix path_get_absolute_path for top-level paths
Close #2833
2015-09-18 14:35:26 -03:00
oni-link
367fc41943 path.c: Fix memory leak in expand_wildcards().
A file that matches with one of the patterns in 'wildignore' is ignored
when using expand_wildcards(). After removing ignored files, the array
of (file name) matches can be empty. But an empty array is never freed.
2015-09-09 19:03:45 +02:00
Felipe Morales
77e416b711 do_path_expand: Avoid non-readable directories. #3273
Closes https://github.com/neovim/neovim/issues/3164
Closes https://github.com/neovim/neovim/issues/3194
Closes https://github.com/neovim/neovim/issues/3221

Helped-by: @splinterofchaos
Helped-by: @oni-link
Helped-by: @justinmk
2015-09-04 19:56:37 -04:00
Steven Oliver
f7c5dc4db2 Remove instances of TRUE/FALSE macro
memory.c
os_unix.c
path.c
2015-09-04 11:07:33 +02:00
Justin M. Keyes
efa059c5a4 test: call scandir_next_with_dots() more than once
Also cosmetic reduction.
2015-08-01 23:33:54 -04:00
Felipe Morales
ea551044ea Add the . and .. entries to glob()
os_scandir() and os_scandir_next() skip over those, because of the
unverlying libuv funcitons behaviour.

Fixes #2954
2015-08-01 23:16:17 -04:00
Mark Bainter
7747bf64d8 minor cleanup. #2610
Update vim_isAbsName() to use bool type
cleanup casts in vim_findfile() and recover_names()

References #2470
2015-05-13 19:42:31 -04:00
John Szakmeister
d3a57b9b0b Fix a wrong expectation for vim_FullName() and FullName_save().
It's the second argument, buf, that cannot be NULL.  fname is allowed to
be NULL.  The issue only showed up on the release build when trying to
use NULL for fname and the test would segfault unexpectedly (because the
NULL check for fname was being optimized out due to the function
attributes).

FullName_save() also incorrectly assumes that fname cannot be NULL
(possibly because of the attribute on vim_FullName), so fix that site as
well.  This didn't have a corresponding test, so it wasn't visible as
test breakage, but did generate a tautological comparison warning in the
release build under Clang.
2015-05-09 09:28:38 -04:00
Mark Bainter
2f60a69baf Update vim_FullName() to define fname as const 2015-05-06 21:34:19 -05:00
Mark Bainter
4ccf2740c8 Make fname const in path_get_absolute_path()
Also a minor change to remove an unneeded cast
2015-05-06 21:34:19 -05:00
Mark Bainter
c55e488079 Remove char_u: concat_fnames() 2015-05-06 21:34:19 -05:00
Mark Bainter
7774b97d57 Remove char_u: fix_fname() 2015-05-06 21:25:05 -05:00
Mark Bainter
80180bf94e Remove char_u: FullName_save() 2015-05-06 21:25:04 -05:00
Mark Bainter
657fd61973 Remove char_u: vim_FullName() 2015-05-06 21:25:04 -05:00
Mark Bainter
789c448d19 Remove char_u: path_with_url() 2015-05-06 21:25:04 -05:00
Mark Bainter
3128ff3798 Remove char_u: path_is_url() 2015-05-06 21:25:04 -05:00
Mark Bainter
f813fdce38 Remove char_u: add_pathsep() 2015-05-06 21:25:04 -05:00
Eliseo Martínez
7c956dcbe8 Enable -Wconversion: normal.c.
Refactor summary:
- extern int opcount --> extern long opcount
- bool find_decl(..., int len, ...) --> bool find_decl(..., size_t len, ...)
  * int find_ident_under_cursor(...) --> size_t find_ident_under_cursor(...)
    - int find_ident_at_pos(...) --> size_t find_ident_at_pos(...)
    - int modify_fname(..., int *usedlen, ..., int *fnamelen) --> int modify_fname(..., size_t *usedlen, ..., size_t *fnamelen)
      * char_u *eval_vars(..., int *usedlen, ...) --> char_u *eval_vars(..., size_t *usedlen, ...)
        - int find_cmdline_var(..., int *usedlen) --> ssize_t find_cmdline_var(..., size_t *usedlen)
        - static char_u *repl_cmdline(..., int srclen, ...) --> static char_u *repl_cmdline(..., size_t srclen, ...)
    - bool get_visual_text(..., int *lenp) --> bool get_visual_text(..., size_t *lenp)
      * char_u *find_file_name_in_path(..., int len, ...) --> char_u *find_file_name_in_path(..., size_t len, ...)
        - static char_u *eval_includeexpr(..., int len) --> static char_u *eval_includeexpr(..., size_t len)
        - char_u *find_file_in_path(..., int len, ...) --> char_u *find_file_in_path(..., size_t len, ...)
          * char_u *find_file_in_path_option(..., int len, ...) --> char_u *find_file_in_path_option(..., size_t len, ...)
            - char_u *find_directory_in_path(..., int len, ...) --> char_u *find_directory_in_path(..., size_t len, ...)
      * int spell_move_to(...) --> size_t spell_move_to(...)
        - int spell_check(...) --> size_t spell_check(...)
        - static int spell_bad_len --> static size_t spell_bad_len
    - void find_pattern_in_path(..., int len, ...) --> void find_pattern_in_path(..., size_t len, ...)

Helped-by: Justin M. Keyes <justinkz@gmail.com>
2015-04-27 19:27:07 +02:00
Mark Bainter
30cdba80dd Refactor after_pathsep() to use const qualified args 2015-04-18 21:37:10 +00:00
Mark Bainter
9a5e87ac83 Remove char_u: after_pathstep()
See: #459
2015-04-17 14:46:58 +00:00
Thiago de Arruda
34c48aaf12 memory: Add free wrapper and refactor project to use it
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.
2015-04-13 08:22:44 -03:00
Justin M. Keyes
86ee88163e passing-by: mark non-null return; remove invalid OOM check.
remove some #ifdef noise
2015-04-12 01:02:58 -04:00
oni-link
adb3ec2026 Update comments for expand_wildcards functions.
Be more specific in the description of mch_expand_wildcards():
This function will never free memory pointed to by its arguments.
If OK is returned, *file will always point to allocated memory.
*num_file is set to the number of pointers in *file.
If FAIL is returned *file is set to NULL and *num_file to 0.

If gen_expand_wildcards() returns FAIL, no memory allocation in this
function needs to be undone.

If expand_wildcards() returns FAIL, no memory allocation in this
function needs to be undone.

Helped-by: Eliseo Martínez <eliseomarmol@gmail.com>
Helped-by: Michael Reed <m.reed@mykolab.com>
2015-04-05 20:27:46 -04:00
Scott Prager
0f4976687d os_scandir: fname_case -> path_fix_case
Use os_scandir().

fname_case() only gets used when `defined(USE_FNAME_CASE)` (on operating
systems with case-insensitive file systems), but may be useful in other
contexts, so move it to path.c. (See the TODO.)

Remove the unused parameter, len.
2015-03-31 11:20:23 -03:00
Scott Prager
24da0d49d0 os_scandir: mch/unix_expandpath() -> path_expand()
Merge unix_expandpath with dos_expandpath from upstream vim and use
os_scandir() over POSIX readdir().
2015-03-31 11:20:23 -03:00
Scott Prager
3f74067565 Un-mch mch_has_(exp_)wildcard().
Merge mch_has_wildcard() and mch_has_exp_wildcar() with their upstream
equivalents for Windows and replace the "mch_" suffix with "path_".
2015-03-31 11:20:23 -03:00
Jonas Dourado
293a7dc134 Remove platform dependent HAVE_OPENDIR #2010 2015-03-17 23:52:50 -04:00
Michael Reed
117bf11e19 Macro cleanup: USE_UNIXFILENAME 2015-03-05 19:03:36 -05:00
Eliseo Martínez
7dd48d7af0 Enable -Wconversion: mark.c.
Refactoring summary:
- MB_STRNICMP: Inlined.
- MB_STRNCMP: Inlined.
2015-02-18 20:54:13 -05:00
Eliseo Martínez
690e43b461 Enable -Wconversion: Passing-by: Remove dead code (MACOS_CONVERT).
MacOS (pre Mac OS X) is not supported anymore.
2015-02-18 20:54:12 -05:00
Eliseo Martínez
883e3a7a73 Remove nonnullret deadcode: xcalloc. 2015-01-27 01:33:33 +01:00
Eliseo Martínez
d228b8a93e Remove nonnullret deadcode: vim_strsave. 2015-01-27 01:33:33 +01:00
Michael Reed
d86ebc7afb Macro cleanup: PROTO
Regarding dict_lookup() in eval.c: both definitions are the same, the
only difference being the spacing between the indirection operator and
the indentation level.
2015-01-14 15:07:16 -05:00
Michael Reed
a62fe49d3c Remove Amiga remnants
Notes regarding the removal of specific items:

  - Aztec C: only on the Amiga.
  - mch_check_win(): doesn't exist anymore.
  - Comment in ex_cmds.c: It seems the context for this comment was
    removed, but the comment was inadvertantly left alone.
2014-12-19 15:28:49 -05:00
Florian Walch
c780075afa vim-patch:7.4.423
Problem:    expand("$shell") does not work as documented.
Solution:   Do not escape the $ when expanding environment variables.

https://code.google.com/p/vim/source/detail?r=v7-4-423
2014-12-18 15:41:27 +01:00
Thiago de Arruda
1865b8c1c1 ui: Remove ui_delay, ui_breakcheck and ui_set_shellsize
These functions only used to call another os_* function, so remove them and
replace all occurences in the project.
2014-11-27 14:27:18 -03:00
Scott Prager
566ce93135 vim-patch:7.4.248
Problem:    Cannot distinguish between NL and NUL in output of system().
Solution:   Add systemlist(). (ZyX)

https://code.google.com/p/vim/source/detail?r=v7-4-248
2014-09-30 19:35:46 -04:00
Scott Prager
9445eaa297 vim-patch:7.4.235
Problem:    It is not easy to get the full path of a command.
Solution:   Add the exepath() function.

https://code.google.com/p/vim/source/detail?r=5ab2946f7ce560985830fbc3c453bb0f7a01f385
2014-09-17 01:00:24 -04:00