diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-04-05 20:27:46 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-04-05 20:27:46 -0400 |
commit | 23425a3a6ec3c86a75b411bd9683d11cfd80ae17 (patch) | |
tree | 25b3368436f980deb1c0c9540df0b37eeb475cf6 /src/nvim/os_unix.c | |
parent | d3bb177f1e1dcbc4104d7bba6f2ac4ebe3ffc9c9 (diff) | |
parent | 8ee6f90bf810a3f0286513308e6cccff7d185666 (diff) | |
download | rneovim-23425a3a6ec3c86a75b411bd9683d11cfd80ae17.tar.gz rneovim-23425a3a6ec3c86a75b411bd9683d11cfd80ae17.tar.bz2 rneovim-23425a3a6ec3c86a75b411bd9683d11cfd80ae17.zip |
Merge #2240 'Fix problem with coverity/105568 fix'
Closes #2230
Diffstat (limited to 'src/nvim/os_unix.c')
-rw-r--r-- | src/nvim/os_unix.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index 70cafc62ca..26a4cdb083 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -189,19 +189,6 @@ void mch_exit(int r) exit(r); } -/* - * mch_expand_wildcards() - this code does wild-card pattern matching using - * the shell - * - * return OK for success, FAIL for error (you may lose some memory) and put - * an error message in *file. - * - * num_pat is number of input patterns - * pat is array of pointers to input patterns - * num_file is pointer to number of matched file names - * file is pointer to array of pointers to matched file names - */ - #ifndef SEEK_SET # define SEEK_SET 0 #endif @@ -211,10 +198,27 @@ void mch_exit(int r) #define SHELL_SPECIAL (char_u *)"\t \"&'$;<>()\\|" +/// Does wildcard pattern matching using the shell. +/// +/// @param num_pat is the number of input patterns. +/// @param pat is an array of pointers to input patterns. +/// @param[out] num_file is pointer to number of matched file names. +/// Set to the number of pointers in *file. +/// @param[out] file is pointer to array of pointers to matched file names. +/// Memory pointed to by the initial value of *file will +/// not be freed. +/// Set to NULL if FAIL is returned. Otherwise points to +/// allocated memory. +/// @param flags is a combination of EW_* flags used in +/// expand_wildcards(). +/// If matching fails but EW_NOTFOUND is set in flags or +/// there are no wildcards, the patterns from pat are +/// copied into *file. +/// +/// @returns OK for success or FAIL for error. int mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, - char_u ***file, - int flags /* EW_* flags */ - ) + char_u ***file, int flags) FUNC_ATTR_NONNULL_ARG(3) + FUNC_ATTR_NONNULL_ARG(4) { int i; size_t len; |