summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre De Dommelin <adedommelin@tuxz.net>2017-03-12 15:49:46 -0700
committerLukas Schwaighofer <lukas@schwaighofer.name>2017-03-12 15:49:46 -0700
commitf0902f3d57cc6e17b59c635b5d2ca813ddc3bd4d (patch)
tree17fe2b2ab40e5b31815480f8d8fbf6a38d762989
parent9d7dc3ecede8de44f32778fd72e6ef809d1274e0 (diff)
fix_gtkcompletionline
# Description: Fixes FTBFS # Author: Rafael Cunha de Almeida <rafael@kontesti.me> Gbp-Pq: Name 60-fix_gtkcompletionline.patch
-rw-r--r--src/gtkcompletionline.cc28
1 files changed, 2 insertions, 26 deletions
diff --git a/src/gtkcompletionline.cc b/src/gtkcompletionline.cc
index a144514..99fdfcf 100644
--- a/src/gtkcompletionline.cc
+++ b/src/gtkcompletionline.cc
@@ -374,30 +374,6 @@ select_executables_only(const struct dirent* dent)
return 0;
}
-int my_alphasort(const void* va, const void* vb) {
- const struct dirent** a = (const struct dirent**)va;
- const struct dirent** b = (const struct dirent**)vb;
-
- const char* s1 = (*a)->d_name;
- const char* s2 = (*b)->d_name;
-
- int l1 = strlen(s1);
- int l2 = strlen(s2);
- int result = strcmp(s1, s2);
-
- if (result == 0) return 0;
-
- if (l1 < l2) {
- int res2 = strncmp(s1, s2, l1);
- if (res2 == 0) return -1;
- } else {
- int res2 = strncmp(s1, s2, l2);
- if (res2 == 0) return 1;
- }
-
- return result;
-}
-
static void
generate_execs()
{
@@ -405,7 +381,7 @@ generate_execs()
for (StrSet::iterator i = path.begin(); i != path.end(); i++) {
struct dirent **eps;
- int n = scandir(i->c_str(), &eps, select_executables_only, my_alphasort);
+ int n = scandir(i->c_str(), &eps, select_executables_only, alphasort);
if (n >= 0) {
for (int j = 0; j < n; j++) {
execs.insert(eps[j]->d_name);
@@ -505,7 +481,7 @@ generate_dirlist(const char *what)
dirlist.clear();
struct dirent **eps;
prefix = filename;
- n = scandir(dest.c_str(), &eps, select_executables_only, my_alphasort);
+ n = scandir(dest.c_str(), &eps, select_executables_only, alphasort);
if (n >= 0) {
for (int j = 0; j < n; j++) {
{