mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Cleanup by moving various (mostly horrible) little bits handling UTF-8 grid
data into functions in a new file, grid-utf8.c, and use sizeof intead of UTF8_DATA. Also nuke trailing whitespace from tmux.1, reminded by jmc.
This commit is contained in:
		
							
								
								
									
										14
									
								
								tty.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								tty.c
									
									
									
									
									
								
							@@ -365,16 +365,12 @@ tty_putc(struct tty *tty, u_char ch)
 | 
			
		||||
void
 | 
			
		||||
tty_pututf8(struct tty *tty, const struct grid_utf8 *gu)
 | 
			
		||||
{
 | 
			
		||||
	u_int	i;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < UTF8_SIZE; i++) {
 | 
			
		||||
		if (gu->data[i] == 0xff)
 | 
			
		||||
			break;
 | 
			
		||||
		bufferevent_write(tty->event, &gu->data[i], 1);
 | 
			
		||||
		if (tty->log_fd != -1)
 | 
			
		||||
			write(tty->log_fd, &gu->data[i], 1);
 | 
			
		||||
	}
 | 
			
		||||
	size_t	size;
 | 
			
		||||
 | 
			
		||||
	size = grid_utf8_size(gu);
 | 
			
		||||
	bufferevent_write(tty->event, gu->data, size);
 | 
			
		||||
	if (tty->log_fd != -1)
 | 
			
		||||
		write(tty->log_fd, gu->data, size);
 | 
			
		||||
	tty->cx += gu->width;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user