commit - 8ecd98cc9ee4478187cb6adc0034ac75a5f2ce36
commit + 3997bf418a991d9a94f4284197da238412f8bf7c
blob - 6a0042a6c04bda58dfac2e11d5b3a4c1697868a2
blob + ac7562584a605267d1889af8cfbad7f39c171e7f
--- mymenu.c
+++ mymenu.c
#endif
#define update_completions(cs, text, lines) { \
- compl_delete(cs); \
+ compl_delete_rec(cs); \
cs = filter(text, lines); \
}
free(c);
}
+void compl_delete_rec(struct completions *c) {
+ while (c != nil) {
+ struct completions *t = c->next;
+ free(c);
+ c = t;
+ }
+}
+
struct completions *compl_select_next(struct completions *c, bool n) {
if (c == nil)
return nil;
int i = 0;
struct completions *root = compl_new();
struct completions *c = root;
+ if (c == nil)
+ return nil;
for (;;) {
char *l = lines[i];
if (strcasestr(l, text) != nil) {
c->next = compl_new();
c = c->next;
+ if (c == nil) {
+ compl_delete_rec(root);
+ return nil;
+ }
c->completion = l;
}
if (XineramaIsActive(d)) {
// find the mice
int number_of_screens = XScreenCount(d);
- bool result;
Window r;
Window root;
int root_x, root_y, win_x, win_y;