mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	Allow a large line number to go to the end with goto-line, from Mark
Kelly in GitHub issue 1460.
This commit is contained in:
		@@ -1273,11 +1273,13 @@ window_copy_goto_line(struct window_pane *wp, const char *linestr)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	struct window_copy_mode_data	*data = wp->modedata;
 | 
						struct window_copy_mode_data	*data = wp->modedata;
 | 
				
			||||||
	const char			*errstr;
 | 
						const char			*errstr;
 | 
				
			||||||
	u_int				 lineno;
 | 
						int				 lineno;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	lineno = strtonum(linestr, 0, screen_hsize(data->backing), &errstr);
 | 
						lineno = strtonum(linestr, -1, INT_MAX, &errstr);
 | 
				
			||||||
	if (errstr != NULL)
 | 
						if (errstr != NULL)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
						if (lineno < 0 || (u_int)lineno > screen_hsize(data->backing))
 | 
				
			||||||
 | 
							lineno = screen_hsize(data->backing);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	data->oy = lineno;
 | 
						data->oy = lineno;
 | 
				
			||||||
	window_copy_update_selection(wp, 1);
 | 
						window_copy_update_selection(wp, 1);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user