diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/actions.c | 6 | ||||
-rw-r--r-- | src/completions.c | 18 | ||||
-rw-r--r-- | src/group.c | 15 | ||||
-rw-r--r-- | src/group.h | 2 | ||||
-rw-r--r-- | src/main.c | 2 |
5 files changed, 39 insertions, 4 deletions
diff --git a/src/actions.c b/src/actions.c index 8b2a04b..b96a279 100644 --- a/src/actions.c +++ b/src/actions.c @@ -3137,8 +3137,12 @@ cmd_fdump (int interactively, char *data) /* FIXME: Oooh, gross! there's a trailing comma, yuk! */ list_for_each_entry (cur, ¤t_screen()->frames, node) { - sbuf_concat (s, frame_dump (cur)); + char *tmp; + + tmp = frame_dump (cur); + sbuf_concat (s, tmp); sbuf_concat (s, ","); + free (tmp); } tmp = sbuf_get (s); diff --git a/src/completions.c b/src/completions.c index 970897d..6f2ed12 100644 --- a/src/completions.c +++ b/src/completions.c @@ -71,6 +71,9 @@ completions_update (rp_completions *c, char *partial) c->partial = xstrdup (partial); completions_assign (c, new_list); + + /* Free the head structure for our list. */ + free (new_list); } /* Return a completed string that starts with partial. */ @@ -80,11 +83,24 @@ completions_next_completion (rp_completions *c, char *partial) struct sbuf *cur; if (c->virgin) - completions_update (c, partial); + { + completions_update (c, partial); + + /* Since it's never been completed on and c->last_match points + to the first element of the list which may be a match. So + check it. FIXME: This is a bit of a hack. */ + if (c->last_match == NULL) + return NULL; + + if (str_comp (sbuf_get (c->last_match), c->partial, strlen (c->partial))) + return sbuf_get (c->last_match); + } if (c->last_match == NULL) return NULL; + /* */ + /* search forward from our last match through the list looking for another match. */ for (cur = list_next_entry (c->last_match, &c->completion_list, node); diff --git a/src/group.c b/src/group.c index b69212e..80ab89e 100644 --- a/src/group.c +++ b/src/group.c @@ -24,7 +24,8 @@ static struct numset *group_numset; -void init_groups() +void +init_groups() { rp_group *g; @@ -38,6 +39,18 @@ void init_groups() list_add_tail (&g->node, &rp_groups); } +void +free_groups() +{ + rp_group *cur; + struct list_head *iter, *tmp; + + list_for_each_safe_entry (cur, iter, tmp, &rp_groups, node) + { + group_free (cur); + } +} + rp_group * group_new (int number, char *name) { diff --git a/src/group.h b/src/group.h index 748c273..87b54af 100644 --- a/src/group.h +++ b/src/group.h @@ -2,6 +2,8 @@ #define GROUP_H void init_groups (); +void free_groups(); + void group_add_window (rp_group *g, rp_window *w); void group_resort_window (rp_group *g, rp_window_elem *w); void group_free (rp_group *g); @@ -774,7 +774,7 @@ clean_up () free_keybindings (); free_aliases (); free_bar (); -/* free_history (); */ + free_groups (); free_window_stuff (); |