aboutsummaryrefslogtreecommitdiffstats
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan2010-02-10 01:23:05 +0000
committerokan2010-02-10 01:23:05 +0000
commit44f1d87ca93fe43f15f30b19704549c26b550c99 (patch)
tree3b1b1a11555b38d72e1f2d3183d5245aae0d7fdb /kbfunc.c
parent1617ae7c9f7259da782c0f829298490c9962ed41 (diff)
downloadcwm-44f1d87ca93fe43f15f30b19704549c26b550c99.tar.gz
preserve labels after an edit action is aborted; extending the menu
struct just for this is the least intrusive approach until the menu code is reviewed. inspired by Thomas Pfaff's report on tech@ ok oga@
Diffstat (limited to 'kbfunc.c')
-rw-r--r--kbfunc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 005d00c..775581b 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.
*
- * $Id: kbfunc.c,v 1.50 2009/12/15 04:10:42 okan Exp $
+ * $Id: kbfunc.c,v 1.51 2010/02/10 01:23:05 okan Exp $
*/
#include <sys/param.h>
@@ -400,19 +400,19 @@ kbfunc_client_label(struct client_ctx *cc, union arg *arg)
{
struct menu *mi;
struct menu_q menuq;
- char *current;
TAILQ_INIT(&menuq);
- current = cc->label;
+ /* dummy is set, so this will always return */
+ mi = menu_filter(cc->sc, &menuq, "label", cc->label, 1,
+ search_match_text, NULL);
- if ((mi = menu_filter(cc->sc, &menuq, "label", current, 1,
- search_match_text, NULL)) != NULL) {
+ if (!mi->abort) {
if (cc->label != NULL)
xfree(cc->label);
cc->label = xstrdup(mi->text);
- xfree(mi);
}
+ xfree(mi);
}
void