aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authoroni-link <knil.ino@gmail.com>2015-03-24 16:54:00 +0100
committerJustin M. Keyes <justinkz@gmail.com>2015-04-05 20:27:46 -0400
commitadb3ec2026c08f6c36f47d4d4348ca6368543a90 (patch)
treeb86e56e4f83a87757e82c609dcbfa3346d5ecbd2 /src/nvim/ex_getln.c
parentd3bb177f1e1dcbc4104d7bba6f2ac4ebe3ffc9c9 (diff)
downloadrneovim-adb3ec2026c08f6c36f47d4d4348ca6368543a90.tar.gz
rneovim-adb3ec2026c08f6c36f47d4d4348ca6368543a90.tar.bz2
rneovim-adb3ec2026c08f6c36f47d4d4348ca6368543a90.zip
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>
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index d430509cfd..cd63b4fa90 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -3810,16 +3810,17 @@ void ExpandGeneric(
reset_expand_highlight();
}
-/*
- * Complete a shell command.
- */
-static void
-expand_shellcmd (
- char_u *filepat, /* pattern to match with command names */
- int *num_file, /* return: number of matches */
- char_u ***file, /* return: array with matches */
- int flagsarg /* EW_ flags */
-)
+/// Complete a shell command.
+///
+/// @param filepat is a pattern to match with command names.
+/// @param[out] num_file is pointer to number of matches.
+/// @param[out] file is pointer to array of pointers to matches.
+/// *file will either be set to NULL or point to
+/// allocated memory.
+/// @param flagsarg is a combination of EW_* flags.
+static void expand_shellcmd(char_u *filepat, int *num_file, char_u ***file,
+ int flagsarg)
+ FUNC_ATTR_NONNULL_ALL
{
char_u *pat;
int i;