patch 7.4.741
Problem: When using += with ":set" a trailing comma is not recognized.
(Issue 365)
Solution: Don't add a second comma. Add a test. (partly by Christian
Brabandt)
diff --git a/src/option.c b/src/option.c
index 7bcb26a..a6ce0ac 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4829,6 +4829,10 @@
if (adding)
{
i = (int)STRLEN(origval);
+ /* strip a trailing comma, would get 2 */
+ if (comma && i > 1 && origval[i - 1] == ','
+ && origval[i - 2] != '\\')
+ i--;
mch_memmove(newval + i + comma, newval,
STRLEN(newval) + 1);
mch_memmove(newval, origval, (size_t)i);
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index 102255d..e7c94c7 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -54,6 +54,7 @@
test_nested_function.out \
test_options.out \
test_qf_title.out \
+ test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
@@ -198,6 +199,7 @@
test_nested_function.out: test_nested_function.in
test_options.out: test_options.in
test_qf_title.out: test_qf_title.in
+test_set.out: test_set.in
test_signs.out: test_signs.in
test_textobjects.out: test_textobjects.in
test_utf8.out: test_utf8.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 787d76e..1eec9d7 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -53,6 +53,7 @@
test_nested_function.out \
test_options.out \
test_qf_title.out \
+ test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index e6942c6..1d0fd36 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -75,6 +75,7 @@
test_nested_function.out \
test_options.out \
test_qf_title.out \
+ test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index 224f695..7b5775c 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -55,6 +55,7 @@
test_nested_function.out \
test_options.out \
test_qf_title.out \
+ test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index a936d27..f0742c7 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
#
-# Last change: 2015 Apr 21
+# Last change: 2015 Jun 19
#
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
# Edit the lines in the Configuration section below to select.
@@ -114,6 +114,7 @@
test_nested_function.out \
test_options.out \
test_qf_title.out \
+ test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index dfcee81..8e54247 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -51,6 +51,7 @@
test_nested_function.out \
test_options.out \
test_qf_title.out \
+ test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
diff --git a/src/testdir/test_set.in b/src/testdir/test_set.in
new file mode 100644
index 0000000..5528ee6
--- /dev/null
+++ b/src/testdir/test_set.in
@@ -0,0 +1,12 @@
+Tests for :set vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:set wildignore=*.png,
+:set wildignore+=*.jpg
+:$put =&wildignore
+:/^Output goes here/+1,$w! test.out
+:qa!
+ENDTEST
+
+Output goes here
diff --git a/src/testdir/test_set.ok b/src/testdir/test_set.ok
new file mode 100644
index 0000000..5d6a708
--- /dev/null
+++ b/src/testdir/test_set.ok
@@ -0,0 +1 @@
+*.png,*.jpg
diff --git a/src/version.c b/src/version.c
index df9b506..6fc420c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 741,
+/**/
740,
/**/
739,