Hi Bram, Anatol and Vim developers!

2015-7-7(Tue) 8:20:43 UTC+9 Anatol Pomozov:
> Is HEAD vim revision still broken? Could developers loos at this bug? Many 
> Arch developers report this issue and we would like to release working 
> version of vim.

I think that is no need to correspond to the "rgba:".
But, Vim is not good to output garbage being displayed which could not be 
interpreted the "Background color response".

So, I wrote a patch.
This patch is suppress to output garbage being displayed, when unknown 
background color response received. (e.g. "11;rgba:aaaa/rrrr/gggg/bbbb")

Please confirm this.
--
Best regards,
Hirohito Higashi

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.
diff -r bfc3682510d6 src/term.c
--- a/src/term.c	Sat Jul 04 15:05:14 2015 +0200
+++ b/src/term.c	Tue Jul 07 13:08:17 2015 +0900
@@ -4272,7 +4272,7 @@
 
 	    if ((*T_CRV != NUL || *T_U7 != NUL || *T_RBG != NUL)
 			&& ((tp[0] == ESC && tp[1] == '[' && len >= 3)
-			    || (tp[0] == ESC && tp[1] == ']' && len >= 24)
+			    || (tp[0] == ESC && tp[1] == ']' && len >= 3)
 			    || (tp[0] == CSI && len >= 2))
 			&& (VIM_ISDIGIT(*argp) || *argp == '>' || *argp == '?'))
 	    {
@@ -4411,28 +4411,51 @@
 		    slen = i + 1;
 		}
 		else if (*T_RBG != NUL
-			&& len >= 24 - (tp[0] == CSI)
-			&& len >= 24 - (tp[0] == CSI) + (argp[21] == ESC)
-			&& argp[0] == '1' && argp[1] == '1'
-			&& argp[2] == ';' && argp[3] == 'r' && argp[4] == 'g'
-			&& argp[5] == 'b' && argp[6] == ':'
+			&& len >= 5 - (tp[0] == CSI)
+			&& argp[0] == '1' && argp[1] == '1' && argp[2] == ';')
+		{
+		    if (len >= 24 - (tp[0] == CSI)
+			&& argp[3] == 'r' && argp[4] == 'g' && argp[5] == 'b'
+			&& argp[6] == ':'
 			&& argp[11] == '/' && argp[16] == '/'
-			&& (argp[21] == '\007' || argp[21] == STERM
-			    || (argp[21] == ESC && argp[22] == '\\')))
-		{
-		    LOG_TR("Received RBG");
-		    rbg_status = RBG_GOT;
-		    if (!option_was_set((char_u *)"bg"))
+			&& (argp[21] == '\007'
+			|| (tp[0] == CSI ? argp[21] == STERM
+			    : len >= 25 && argp[21] == ESC && argp[22] == '\\'))
+			&& !option_was_set((char_u *)"bg"))
 		    {
+			LOG_TR("Received RBG");
+			rbg_status = RBG_GOT;
 			set_option_value((char_u *)"bg", 0L, (char_u *)(
 				    (3 * '6' < argp[7] + argp[12] + argp[17])
 						      ? "light" : "dark"), 0);
 			reset_option_was_set((char_u *)"bg");
 			redraw_asap(CLEAR);
+
+			key_name[0] = (int)KS_EXTRA;
+			key_name[1] = (int)KE_IGNORE;
+			slen = 24 - (tp[0] == CSI) + (argp[21] == ESC);
 		    }
-		    key_name[0] = (int)KS_EXTRA;
-		    key_name[1] = (int)KE_IGNORE;
-		    slen = 24 - (tp[0] == CSI) + (argp[21] == ESC);
+		    else
+		    {
+			j = 2 - (tp[0] == CSI);
+			for (i = j; i < len; ++i)
+			    if (tp[i] == '\007'
+				|| (tp[0] == CSI ? tp[i] == STERM
+				: i + 1 < len && tp[i] == ESC && tp[i + 1] == '\\'))
+			    {
+				LOG_TR("Received unknown RBG");
+				key_name[0] = (int)KS_EXTRA;
+				key_name[1] = (int)KE_IGNORE;
+				slen = i + 1 + (tp[i] == ESC);
+				break;
+			    }
+
+			if (i == len)
+			{
+			    LOG_TR("not enough characters for RB");
+			    return -1;		/* not enough characters */
+			}
+		    }
 		}
 	    }
 

Raspunde prin e-mail lui