Skip to content

Commit

Permalink
Fix cleanup multikey mappings (FreeBSD bin/182463)
Browse files Browse the repository at this point in the history
It's a regression caused by the SLIST migration; the code detects
for multikey (screen-specific) mappings but always delete from
the head of the list.
  • Loading branch information
Wolfgang Jenkner authored and lichray committed Dec 7, 2013
1 parent 7bb577c commit c80f493
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cl/cl_term.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "config.h"

#ifndef lint
static const char sccsid[] = "$Id: cl_term.c,v 10.33 2012/04/21 23:51:46 zy Exp $";
static const char sccsid[] = "$Id: cl_term.c,v 10.34 2013/12/07 16:21:14 wjenkner Exp $";
#endif /* not lint */

#include <sys/types.h>
Expand Down Expand Up @@ -187,14 +187,18 @@ cl_term_init(SCR *sp)
int
cl_term_end(GS *gp)
{
SEQ *qp, *nqp;
SEQ *qp, *nqp, *pre_qp = NULL;

/* Delete screen specific mappings. */
SLIST_FOREACH_SAFE(qp, gp->seqq, q, nqp)
if (F_ISSET(qp, SEQ_SCREEN)) {
SLIST_REMOVE_HEAD(gp->seqq, q);
if (qp == SLIST_FIRST(gp->seqq))
SLIST_REMOVE_HEAD(gp->seqq, q);
else
SLIST_REMOVE_AFTER(pre_qp, q);
(void)seq_free(qp);
}
} else
pre_qp = qp;
return (0);
}

Expand Down

0 comments on commit c80f493

Please sign in to comment.