diff options
author | okan | 2012-12-17 14:32:39 +0000 |
---|---|---|
committer | okan | 2012-12-17 14:32:39 +0000 |
commit | c41d09cb1ce845c96079c6bc1e204e62caf32b95 (patch) | |
tree | b245825ac245104c8c5bf701e726234d9df75d46 /mousefunc.c | |
parent | 43033f15ed112e90c2a62d9facdbfbf1ad5b61ee (diff) | |
download | cwm-c41d09cb1ce845c96079c6bc1e204e62caf32b95.tar.gz |
create and use menuq_clear() helper; from Tiago Cunha
Diffstat (limited to '')
-rw-r--r-- | mousefunc.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/mousefunc.c b/mousefunc.c index 01881e1..f5ea3f0 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: mousefunc.c,v 1.41 2012/12/17 02:28:45 okan Exp $ + * $OpenBSD: mousefunc.c,v 1.42 2012/12/17 14:32:39 okan Exp $ */ #include <sys/param.h> @@ -250,12 +250,8 @@ mousefunc_menu_unhide(struct client_ctx *cc, void *arg) if (old_cc != NULL) client_ptrsave(old_cc); client_ptrwarp(cc); - } else { - while ((mi = TAILQ_FIRST(&menuq)) != NULL) { - TAILQ_REMOVE(&menuq, mi, entry); - free(mi); - } - } + } else + menuq_clear(&menuq); } void @@ -280,8 +276,5 @@ mousefunc_menu_cmd(struct client_ctx *cc, void *arg) if (mi != NULL) u_spawn(((struct cmd *)mi->ctx)->image); else - while ((mi = TAILQ_FIRST(&menuq)) != NULL) { - TAILQ_REMOVE(&menuq, mi, entry); - free(mi); - } + menuq_clear(&menuq); } |