]> granicus.if.org Git - vim/commitdiff
patch 7.4.741 v7.4.741
authorBram Moolenaar <Bram@vim.org>
Fri, 19 Jun 2015 12:06:43 +0000 (14:06 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 19 Jun 2015 12:06:43 +0000 (14:06 +0200)
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)

src/option.c
src/testdir/Make_amiga.mak
src/testdir/Make_dos.mak
src/testdir/Make_ming.mak
src/testdir/Make_os2.mak
src/testdir/Make_vms.mms
src/testdir/Makefile
src/testdir/test_set.in [new file with mode: 0644]
src/testdir/test_set.ok [new file with mode: 0644]
src/version.c

index 7bcb26abcf07efb6783119e9ec30d1fd7e54ba9f..a6ce0ac6334828aebcc031470dcbddae3687f406 100644 (file)
@@ -4829,6 +4829,10 @@ do_set(arg, opt_flags)
                                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);
index 102255dfd0bdcb531b6b99f458daa010195d98a9..e7c94c7e906d14f15497474a2d1feeb5dfb09909 100644 (file)
@@ -54,6 +54,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
                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_marks.out: test_marks.in
 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
index 787d76eaa0a5a1f9fe63761beab7b40e136651cd..1eec9d70518ad918f774aa7c7dd5d2b43e31707a 100644 (file)
@@ -53,6 +53,7 @@ SCRIPTS =     test3.out test4.out test5.out test6.out test7.out \
                test_nested_function.out \
                test_options.out \
                test_qf_title.out \
+               test_set.out \
                test_signs.out \
                test_textobjects.out \
                test_utf8.out
index e6942c62385d16a93f8b67a94e9e86c09c14f4f9..1d0fd36465f2e802c05b0260b64f5d1f5c6867e3 100644 (file)
@@ -75,6 +75,7 @@ SCRIPTS =     test3.out test4.out test5.out test6.out test7.out \
                test_nested_function.out \
                test_options.out \
                test_qf_title.out \
+               test_set.out \
                test_signs.out \
                test_textobjects.out \
                test_utf8.out
index 224f6951abc5fa26f16d55ad6e228ed374a6c515..7b5775c895b3b41a36f7d44a9bead72efe82601d 100644 (file)
@@ -55,6 +55,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
                test_nested_function.out \
                test_options.out \
                test_qf_title.out \
+               test_set.out \
                test_signs.out \
                test_textobjects.out \
                test_utf8.out
index a936d2722e70a48504085b55db58e525b9486429..f0742c74fae99d76b79ef058686a9192c6fa3187 100644 (file)
@@ -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 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
         test_nested_function.out \
         test_options.out \
         test_qf_title.out \
+        test_set.out \
         test_signs.out \
         test_textobjects.out \
         test_utf8.out
index dfcee819947574f43ea9551e3a770fba0fd6b32a..8e542470ae5982ea1aa8714a0a558e50a4ce80c1 100644 (file)
@@ -51,6 +51,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
                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 (file)
index 0000000..5528ee6
--- /dev/null
@@ -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 (file)
index 0000000..5d6a708
--- /dev/null
@@ -0,0 +1 @@
+*.png,*.jpg
index df9b506a08a727df8ac7ba37c851c6c433334b07..6fc420cbd0f6326127d1395948c8297ee4ff8acd 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    741,
 /**/
     740,
 /**/