mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Only accept DA and DA2 when they end in 'c', stops them being confused
with theme responses.. GitHub issue 4561.
This commit is contained in:
		
							
								
								
									
										16
									
								
								tty-keys.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								tty-keys.c
									
									
									
									
									
								
							| @@ -1422,14 +1422,16 @@ tty_keys_device_attributes(struct tty *tty, const char *buf, size_t len, | |||||||
| 		return (1); | 		return (1); | ||||||
|  |  | ||||||
| 	/* Copy the rest up to a c. */ | 	/* Copy the rest up to a c. */ | ||||||
| 	for (i = 0; i < (sizeof tmp); i++) { | 	for (i = 0; i < sizeof tmp; i++) { | ||||||
| 		if (3 + i == len) | 		if (3 + i == len) | ||||||
| 			return (1); | 			return (1); | ||||||
| 		if (buf[3 + i] == 'c') | 		if (buf[3 + i] >= 'a' && buf[3 + i] <= 'z') | ||||||
| 			break; | 			break; | ||||||
| 		tmp[i] = buf[3 + i]; | 		tmp[i] = buf[3 + i]; | ||||||
| 	} | 	} | ||||||
| 	if (i == (sizeof tmp)) | 	if (i == sizeof tmp) | ||||||
|  | 		return (-1); | ||||||
|  | 	if (buf[3 + i] != 'c') | ||||||
| 		return (-1); | 		return (-1); | ||||||
| 	tmp[i] = '\0'; | 	tmp[i] = '\0'; | ||||||
| 	*size = 4 + i; | 	*size = 4 + i; | ||||||
| @@ -1504,14 +1506,16 @@ tty_keys_device_attributes2(struct tty *tty, const char *buf, size_t len, | |||||||
| 		return (1); | 		return (1); | ||||||
|  |  | ||||||
| 	/* Copy the rest up to a c. */ | 	/* Copy the rest up to a c. */ | ||||||
| 	for (i = 0; i < (sizeof tmp); i++) { | 	for (i = 0; i < sizeof tmp; i++) { | ||||||
| 		if (3 + i == len) | 		if (3 + i == len) | ||||||
| 			return (1); | 			return (1); | ||||||
| 		if (buf[3 + i] == 'c') | 		if (buf[3 + i] >= 'a' && buf[3 + i] <= 'z') | ||||||
| 			break; | 			break; | ||||||
| 		tmp[i] = buf[3 + i]; | 		tmp[i] = buf[3 + i]; | ||||||
| 	} | 	} | ||||||
| 	if (i == (sizeof tmp)) | 	if (i == sizeof tmp) | ||||||
|  | 		return (-1); | ||||||
|  | 	if (buf[3 + i] != 'c') | ||||||
| 		return (-1); | 		return (-1); | ||||||
| 	tmp[i] = '\0'; | 	tmp[i] = '\0'; | ||||||
| 	*size = 4 + i; | 	*size = 4 + i; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 nicm
					nicm