mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		
							
								
								
									
										16
									
								
								session.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								session.c
									
									
									
									
									
								
							@@ -69,6 +69,22 @@ session_find(const char *name)
 | 
			
		||||
	return (RB_FIND(sessions, &sessions, &s));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Find session by id parsed from a string. */
 | 
			
		||||
struct session *
 | 
			
		||||
session_find_by_id_str(const char *s)
 | 
			
		||||
{
 | 
			
		||||
	const char	*errstr;
 | 
			
		||||
	u_int		 id;
 | 
			
		||||
 | 
			
		||||
	if (*s != '$')
 | 
			
		||||
		return (NULL);
 | 
			
		||||
 | 
			
		||||
	id = strtonum(s + 1, 0, UINT_MAX, &errstr);
 | 
			
		||||
	if (errstr != NULL)
 | 
			
		||||
		return (NULL);
 | 
			
		||||
	return (session_find_by_id(id));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Find session by id. */
 | 
			
		||||
struct session *
 | 
			
		||||
session_find_by_id(u_int id)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user