mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Can't call evtimer_pending on uninitialized events, call
evtimer_initialized first. Reported by Vladimir Lomov, fix from Thomas Adam slightly modified by me.
This commit is contained in:
		
				
					committed by
					
						
						Thomas Adam
					
				
			
			
				
	
			
			
			
						parent
						
							c06b2e4fb9
						
					
				
				
					commit
					d6066552ee
				
			@@ -533,6 +533,7 @@ partial_key:
 | 
			
		||||
	 * timer has expired, give up waiting and send the escape.
 | 
			
		||||
	 */
 | 
			
		||||
	if ((tty->flags & TTY_ESCAPE) &&
 | 
			
		||||
	    evtimer_initialized(&tty->key_timer) &&
 | 
			
		||||
	    !evtimer_pending(&tty->key_timer, NULL)) {
 | 
			
		||||
		evbuffer_drain(tty->event->input, 1);
 | 
			
		||||
		key = '\033';
 | 
			
		||||
@@ -543,7 +544,8 @@ partial_key:
 | 
			
		||||
 | 
			
		||||
start_timer:
 | 
			
		||||
	/* If already waiting for timer, do nothing. */
 | 
			
		||||
	if (evtimer_pending(&tty->key_timer, NULL))
 | 
			
		||||
	if (evtimer_initialized(&tty->key_timer) &&
 | 
			
		||||
	    evtimer_pending(&tty->key_timer, NULL))
 | 
			
		||||
		return (0);
 | 
			
		||||
 | 
			
		||||
	/* Start the timer and wait for expiry or more data. */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user