mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
Do not crash on empty list in run dialog.
This commit is contained in:
parent
d0f9f6f067
commit
10cdd0e48e
1 changed files with 4 additions and 0 deletions
|
@ -225,6 +225,10 @@ static char ** get_apps ( char **retv, unsigned int *length )
|
||||||
if ( config.run_list_command != NULL && config.run_list_command[0] != '\0' ) {
|
if ( config.run_list_command != NULL && config.run_list_command[0] != '\0' ) {
|
||||||
retv = get_apps_external ( retv, length );
|
retv = get_apps_external ( retv, length );
|
||||||
}
|
}
|
||||||
|
// No sorting needed.
|
||||||
|
if((*length) == 0) {
|
||||||
|
return retv;
|
||||||
|
}
|
||||||
// TODO: check this is still fast enough. (takes 1ms on laptop.)
|
// TODO: check this is still fast enough. (takes 1ms on laptop.)
|
||||||
if ( ( *length ) > num_favorites ) {
|
if ( ( *length ) > num_favorites ) {
|
||||||
qsort ( &retv[num_favorites], ( *length ) - num_favorites, sizeof ( char* ), sort_func );
|
qsort ( &retv[num_favorites], ( *length ) - num_favorites, sizeof ( char* ), sort_func );
|
||||||
|
|
Loading…
Reference in a new issue