aboutsummaryrefslogtreecommitdiffstats
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan2012-12-17 14:32:39 +0000
committerokan2012-12-17 14:32:39 +0000
commitc41d09cb1ce845c96079c6bc1e204e62caf32b95 (patch)
treeb245825ac245104c8c5bf701e726234d9df75d46 /kbfunc.c
parent43033f15ed112e90c2a62d9facdbfbf1ad5b61ee (diff)
downloadcwm-c41d09cb1ce845c96079c6bc1e204e62caf32b95.tar.gz
create and use menuq_clear() helper; from Tiago Cunha
Diffstat (limited to '')
-rw-r--r--kbfunc.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 3bf2c9d..f58982b 100644
--- a/kbfunc.c
+++ b/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