changeset 24412:0e0943dfdbf9 v8.2.2746

patch 8.2.2746: check for duplicate arguments does not work Commit: https://github.com/vim/vim/commit/87795939d01932b0d8155fd69c7494fa51c523f3 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 10 18:21:30 2021 +0200 patch 8.2.2746: check for duplicate arguments does not work Problem: Check for duplicate arguments does not work. Solution: Correct condition.
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Apr 2021 18:30:04 +0200
parents ee92164bcb76
children 697068ea926d
files src/userfunc.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -109,7 +109,7 @@ one_function_arg(
 	    return arg;
 	}
 	is_underscore = arg_copy[0] == '_' && arg_copy[1] == NUL;
-	if (argtypes != NULL && !is_underscore)
+	if (argtypes == NULL || !is_underscore)
 	    // Check for duplicate argument name.
 	    for (i = 0; i < newargs->ga_len; ++i)
 		if (STRCMP(((char_u **)(newargs->ga_data))[i], arg_copy) == 0)
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2746,
+/**/
     2745,
 /**/
     2744,