summaryrefslogtreecommitdiff
path: root/app/cwm/kbfunc.c
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2012-12-17 14:32:40 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2012-12-17 14:32:40 +0000
commit5133a28524f122a650ccda9f966bc15bfd0f9b5a (patch)
treeacce2f7f85114179ad622d83fd4f2634ceedb514 /app/cwm/kbfunc.c
parent90c4b20838683daf77774e055cad198d426fee80 (diff)
create and use menuq_clear() helper; from Tiago Cunha
Diffstat (limited to 'app/cwm/kbfunc.c')
-rw-r--r--app/cwm/kbfunc.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c
index 3bf2c9d90..f58982b5a 100644
--- a/app/cwm/kbfunc.c
+++ b/app/cwm/kbfunc.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: kbfunc.c,v 1.68 2012/11/09 03:52:02 okan Exp $
+ * $OpenBSD: kbfunc.c,v 1.69 2012/12/17 14:32:39 okan Exp $
*/
#include <sys/param.h>
@@ -168,10 +168,7 @@ kbfunc_client_search(struct client_ctx *cc, union arg *arg)
client_ptrwarp(cc);
}
- while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
- TAILQ_REMOVE(&menuq, mi, entry);
- free(mi);
- }
+ menuq_clear(&menuq);
}
void
@@ -195,10 +192,7 @@ kbfunc_menu_search(struct client_ctx *cc, union arg *arg)
search_match_text, NULL)) != NULL)
u_spawn(((struct cmd *)mi->ctx)->image);
- while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
- TAILQ_REMOVE(&menuq, mi, entry);
- free(mi);
- }
+ menuq_clear(&menuq);
}
void
@@ -320,10 +314,7 @@ kbfunc_exec(struct client_ctx *cc, union arg *arg)
out:
if (mi != NULL && mi->dummy)
free(mi);
- while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
- TAILQ_REMOVE(&menuq, mi, entry);
- free(mi);
- }
+ menuq_clear(&menuq);
}
void
@@ -390,10 +381,7 @@ kbfunc_ssh(struct client_ctx *cc, union arg *arg)
out:
if (mi != NULL && mi->dummy)
free(mi);
- while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
- TAILQ_REMOVE(&menuq, mi, entry);
- free(mi);
- }
+ menuq_clear(&menuq);
}
void