diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-05-29 16:44:26 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-05-29 16:44:26 +0200 |
commit | ef3abc6442260e9a0314970a532400b05571d3fe (patch) | |
tree | 258d8be9d890774d2ea658abc3185ff96d3b32a3 /src | |
parent | b127cfd75f59e82580df395b6e2c009774644b16 (diff) |
patch 7.4.1859v7.4.1859
Problem: Cannot use a function reference for "exit_cb".
Solution: Use get_callback(). (Yegappan Lakshmanan)
Diffstat (limited to 'src')
-rw-r--r-- | src/channel.c | 33 | ||||
-rw-r--r-- | src/structs.h | 1 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 16 insertions, 20 deletions
diff --git a/src/channel.c b/src/channel.c index b1f7f1a605..75cadae7ab 100644 --- a/src/channel.c +++ b/src/channel.c @@ -3839,6 +3839,8 @@ free_job_options(jobopt_T *opt) 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,6 +4053,18 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported) 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,25 +4127,6 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported) 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)) diff --git a/src/structs.h b/src/structs.h index d5f8adc83a..08d3325431 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1529,7 +1529,6 @@ typedef struct int jo_id; char_u jo_soe_buf[NUMBUFLEN]; char_u *jo_stoponexit; - char_u jo_ecb_buf[NUMBUFLEN]; } jobopt_T; diff --git a/src/version.c b/src/version.c index 85f57e58b7..eb9f2c7112 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1859, +/**/ 1858, /**/ 1857, |