60-fix_gtkcompletionline.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Description: Fixes FTBFS
  2. # Author: Rafael Cunha de Almeida <rafael@kontesti.me>
  3. Index: gmrun-0.9.2/src/gtkcompletionline.cc
  4. ===================================================================
  5. --- gmrun-0.9.2.orig/src/gtkcompletionline.cc 2010-03-07 14:53:19.000000000 +0000
  6. +++ gmrun-0.9.2/src/gtkcompletionline.cc 2010-03-07 14:53:53.000000000 +0000
  7. @@ -374,30 +374,6 @@
  8. return 0;
  9. }
  10. -int my_alphasort(const void* va, const void* vb) {
  11. - const struct dirent** a = (const struct dirent**)va;
  12. - const struct dirent** b = (const struct dirent**)vb;
  13. -
  14. - const char* s1 = (*a)->d_name;
  15. - const char* s2 = (*b)->d_name;
  16. -
  17. - int l1 = strlen(s1);
  18. - int l2 = strlen(s2);
  19. - int result = strcmp(s1, s2);
  20. -
  21. - if (result == 0) return 0;
  22. -
  23. - if (l1 < l2) {
  24. - int res2 = strncmp(s1, s2, l1);
  25. - if (res2 == 0) return -1;
  26. - } else {
  27. - int res2 = strncmp(s1, s2, l2);
  28. - if (res2 == 0) return 1;
  29. - }
  30. -
  31. - return result;
  32. -}
  33. -
  34. static void
  35. generate_execs()
  36. {
  37. @@ -405,7 +381,7 @@
  38. for (StrSet::iterator i = path.begin(); i != path.end(); i++) {
  39. struct dirent **eps;
  40. - int n = scandir(i->c_str(), &eps, select_executables_only, my_alphasort);
  41. + int n = scandir(i->c_str(), &eps, select_executables_only, alphasort);
  42. if (n >= 0) {
  43. for (int j = 0; j < n; j++) {
  44. execs.insert(eps[j]->d_name);
  45. @@ -505,7 +481,7 @@
  46. dirlist.clear();
  47. struct dirent **eps;
  48. prefix = filename;
  49. - n = scandir(dest.c_str(), &eps, select_executables_only, my_alphasort);
  50. + n = scandir(dest.c_str(), &eps, select_executables_only, alphasort);
  51. if (n >= 0) {
  52. for (int j = 0; j < n; j++) {
  53. {