mirror of
https://github.com/lbonn/rofi.git
synced 2025-12-01 12:07:41 +00:00
Fix a few minor bugs
This commit is contained in:
@ -115,7 +115,7 @@ static pid_t exec_ssh( const char *cmd )
|
||||
fclose( fd );
|
||||
}
|
||||
|
||||
for ( int i=0; retv[i] != NULL; i++ ) {
|
||||
for ( int i=0; retv != NULL && retv[i] != NULL; i++ ) {
|
||||
free( retv[i] );
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ static void delete_ssh( const char *cmd )
|
||||
fclose( fd );
|
||||
}
|
||||
|
||||
for ( int i=0; retv[i] != NULL; i++ ) {
|
||||
for ( int i=0; retv != NULL && retv[i] != NULL; i++ ) {
|
||||
free( retv[i] );
|
||||
}
|
||||
|
||||
@ -307,7 +307,6 @@ SwitcherMode ssh_switcher_dialog ( char **input )
|
||||
int shift=0;
|
||||
int selected_line = 0;
|
||||
int mretv = menu( cmd_list, input, "ssh", NULL, &shift,token_match, NULL , &selected_line );
|
||||
|
||||
if ( mretv == MENU_NEXT ) {
|
||||
retv = NEXT_DIALOG;
|
||||
} else if ( mretv == MENU_OK && cmd_list[selected_line] != NULL ) {
|
||||
@ -316,6 +315,8 @@ SwitcherMode ssh_switcher_dialog ( char **input )
|
||||
exec_ssh( *input );
|
||||
} else if ( mretv == MENU_ENTRY_DELETE && cmd_list[selected_line] ) {
|
||||
delete_ssh ( cmd_list[selected_line] );
|
||||
// Stay
|
||||
retv = SSH_DIALOG;
|
||||
}
|
||||
|
||||
for ( int i=0; cmd_list[i] != NULL; i++ ) {
|
||||
|
||||
Reference in New Issue
Block a user