Merge pull request #546 from ThrosturX/master
fixed a segfault on attempting to open a void selection in a newly op…
This commit is contained in:
		
						commit
						86db8ab133
					
				@ -564,6 +564,13 @@ static void move_to_row_start(VteTerminal *vte, select_info *select, long row) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void open_selection(char *browser, VteTerminal *vte) {
 | 
					static void open_selection(char *browser, VteTerminal *vte) {
 | 
				
			||||||
 | 
					    // If the terminal has been opened, but no selection has ever been made
 | 
				
			||||||
 | 
					    // , a segfault will occur upon attempting to make the unique pointer 
 | 
				
			||||||
 | 
					    // within vte_terminal_get_selection(vte) (unless if there is no browser).
 | 
				
			||||||
 | 
					    if (!vte_terminal_get_has_selection(vte)) {
 | 
				
			||||||
 | 
					        g_printerr("no selection to open\n");
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    if (browser) {
 | 
					    if (browser) {
 | 
				
			||||||
        auto selection = make_unique(vte_terminal_get_selection(vte), g_free);
 | 
					        auto selection = make_unique(vte_terminal_get_selection(vte), g_free);
 | 
				
			||||||
        if (selection && *selection) {
 | 
					        if (selection && *selection) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user