To: vim_dev@googlegroups.com Subject: Patch 7.4.1859 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1859 Problem: Cannot use a function reference for "exit_cb". Solution: Use get_callback(). (Yegappan Lakshmanan) Files: src/channel.c, src/structs.h *** ../vim-7.4.1858/src/channel.c 2016-05-29 16:24:45.949320300 +0200 --- src/channel.c 2016-05-29 16:39:22.669308240 +0200 *************** *** 3839,3844 **** --- 3839,3846 ---- partial_unref(opt->jo_err_partial); if (opt->jo_close_partial != NULL) partial_unref(opt->jo_close_partial); + if (opt->jo_exit_partial != NULL) + partial_unref(opt->jo_exit_partial); } /* *************** *** 4051,4056 **** --- 4053,4070 ---- return FAIL; } } + else if (STRCMP(hi->hi_key, "exit_cb") == 0) + { + if (!(supported & JO_EXIT_CB)) + break; + opt->jo_set |= JO_EXIT_CB; + opt->jo_exit_cb = get_callback(item, &opt->jo_exit_partial); + if (opt->jo_exit_cb == NULL) + { + EMSG2(_(e_invarg2), "exit_cb"); + return FAIL; + } + } else if (STRCMP(hi->hi_key, "waittime") == 0) { if (!(supported & JO_WAITTIME)) *************** *** 4113,4137 **** return FAIL; } } - else if (STRCMP(hi->hi_key, "exit_cb") == 0) - { - if (!(supported & JO_EXIT_CB)) - break; - opt->jo_set |= JO_EXIT_CB; - if (item->v_type == VAR_PARTIAL && item->vval.v_partial != NULL) - { - opt->jo_exit_partial = item->vval.v_partial; - opt->jo_exit_cb = item->vval.v_partial->pt_name; - } - else - opt->jo_exit_cb = get_tv_string_buf_chk( - item, opt->jo_ecb_buf); - if (opt->jo_exit_cb == NULL) - { - EMSG2(_(e_invarg2), "exit_cb"); - return FAIL; - } - } else if (STRCMP(hi->hi_key, "block_write") == 0) { if (!(supported & JO_BLOCK_WRITE)) --- 4127,4132 ---- *** ../vim-7.4.1858/src/structs.h 2016-05-29 16:16:39.381326993 +0200 --- src/structs.h 2016-05-29 16:37:14.641310001 +0200 *************** *** 1529,1535 **** int jo_id; char_u jo_soe_buf[NUMBUFLEN]; char_u *jo_stoponexit; - char_u jo_ecb_buf[NUMBUFLEN]; } jobopt_T; --- 1529,1534 ---- *** ../vim-7.4.1858/src/version.c 2016-05-29 16:24:45.957320300 +0200 --- src/version.c 2016-05-29 16:43:54.213304505 +0200 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 1859, /**/ -- How To Keep A Healthy Level Of Insanity: 9. As often as possible, skip rather than walk. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///