Bram,
there seems to be a problem with substitute¹:

#v+
~$ vim -u NONE -N :echo substitute('-bb', '\zeb', 'a', 'g') -c ':q!'
-aabab
Press ENTER or type command to continue
~$
#v-

That looks wrong. Attach is patch that fixes it.
¹)http://stackoverflow.com/questions/19041109

Mit freundlichen Grüßen
Christian
-- 
Wo viel Ehrgefühl, da ist viel Ehrgeiz; aber gar nicht umgekehrt.
                -- Jean Paul

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
diff --git a/src/eval.c b/src/eval.c
--- a/src/eval.c
+++ b/src/eval.c
@@ -24350,6 +24350,11 @@
 	    else
 	    {
 		tail = regmatch.endp[0];
+		if (regmatch.startp[0] == regmatch.endp[0])
+		{
+		    *((char_u *)ga.ga_data + ga.ga_len) = *tail++;
+		    ++ga.ga_len;
+		}
 		if (*tail == NUL)
 		    break;
 	    }
diff --git a/src/testdir/test80.in b/src/testdir/test80.in
--- a/src/testdir/test80.in
+++ b/src/testdir/test80.in
@@ -142,6 +142,7 @@
 :$put =\"\n\nTEST_7:\"
 :$put =substitute('A
A', 'A.', '\=submatch(0)', '')
 :$put =substitute(\"B\nB\", 'B.', '\=submatch(0)', '')
+:$put =substitute('-bb', '\zeb', 'a', 'g')
 /^TEST_8
 ENDTEST
 
diff --git a/src/testdir/test80.ok b/src/testdir/test80.ok
--- a/src/testdir/test80.ok
+++ b/src/testdir/test80.ok
@@ -103,6 +103,7 @@
 A
A
 B
 B
+-abab
 
 
 TEST_8:

Raspunde prin e-mail lui