Skip to content

Commit

Permalink
Fix missed sort op
Browse files Browse the repository at this point in the history
  • Loading branch information
pelijah committed May 11, 2024
1 parent a36d2bf commit e35d23d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion librz/core/cmd/cmd_eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ RZ_API char *rz_core_theme_get(RzCore *core) {
return core->curtheme;
}

static int compare_strings(const char *s1, const char *s2, RZ_UNUSED void *user) {
return strcmp(s1, s2);
}

/**
* \brief Returns the list of the rizin themes.
*
Expand Down Expand Up @@ -128,7 +132,8 @@ RZ_API RZ_OWN RzPVector /*<char *>*/ *rz_core_theme_list(RZ_NONNULL RzCore *core
set_s_free(themes);
return NULL;
}
rz_pvector_push_front(vec, strdup("default"));
rz_pvector_push(vec, strdup("default"));
rz_pvector_sort(vec, (RzPVectorComparator)compare_strings, NULL);
set_s_free(themes);
return vec;
}
Expand Down
1 change: 0 additions & 1 deletion librz/core/tui/panels.c
Original file line number Diff line number Diff line change
Expand Up @@ -6162,7 +6162,6 @@ RZ_IPI bool rz_core_visual_panels_root(RzCore *core, RzPanelsRoot *panels_root)
panels_root->cur_tab = 0;
__set_root_state(core, DEFAULT);
panels_root->theme_list = rz_core_theme_list(core);
rz_pvector_sort(panels_root->theme_list, cmpstr, NULL);
__init_new_panels_root(core);
} else {
if (rz_pvector_len(&panels_root->tabs) == 0) {
Expand Down

0 comments on commit e35d23d

Please sign in to comment.