mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	OpenBSD wcwidth() is sensible and complete so if it returns -1 it means
that a character is not printable, so return to ignoring such characters.
This commit is contained in:
		
							
								
								
									
										8
									
								
								utf8.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								utf8.c
									
									
									
									
									
								
							@@ -119,14 +119,6 @@ utf8_width(wchar_t wc)
 | 
			
		||||
	width = wcwidth(wc);
 | 
			
		||||
	if (width < 0 || width > 0xff) {
 | 
			
		||||
		log_debug("Unicode %04x, wcwidth() %d", wc, width);
 | 
			
		||||
 | 
			
		||||
		/*
 | 
			
		||||
		 * Many platforms have no width for relatively common
 | 
			
		||||
		 * characters (wcwidth() returns -1); assume width 1 in this
 | 
			
		||||
		 * case and hope for the best.
 | 
			
		||||
		 */
 | 
			
		||||
		if (width < 0)
 | 
			
		||||
			return (1);
 | 
			
		||||
		return (-1);
 | 
			
		||||
	}
 | 
			
		||||
	return (width);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user