mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Handle empty or unset TERM correctly; also fix a fatal() message while here.
This commit is contained in:
		
							
								
								
									
										4
									
								
								tty.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								tty.c
									
									
									
									
									
								
							@@ -76,7 +76,7 @@ void
 | 
			
		||||
tty_init(struct tty *tty, char *path, char *term)
 | 
			
		||||
{
 | 
			
		||||
	tty->path = xstrdup(path);
 | 
			
		||||
	if (term == NULL)
 | 
			
		||||
	if (term == NULL || *term == '\0')
 | 
			
		||||
		tty->termname = xstrdup("unknown");
 | 
			
		||||
	else
 | 
			
		||||
		tty->termname = xstrdup(term);
 | 
			
		||||
@@ -98,7 +98,7 @@ tty_open(struct tty *tty, char **cause)
 | 
			
		||||
	if ((mode = fcntl(tty->fd, F_GETFL)) == -1)
 | 
			
		||||
		fatal("fcntl failed");
 | 
			
		||||
	if (fcntl(tty->fd, F_SETFL, mode|O_NONBLOCK) == -1)
 | 
			
		||||
		fatal("fcntl failedo");
 | 
			
		||||
		fatal("fcntl failed");
 | 
			
		||||
	if (fcntl(tty->fd, F_SETFD, FD_CLOEXEC) == -1)
 | 
			
		||||
		fatal("fcntl failed");
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user