Skip to content

Commit

Permalink
patch 7.4.1859
Browse files Browse the repository at this point in the history
Problem:    Cannot use a function reference for "exit_cb".
Solution:   Use get_callback(). (Yegappan Lakshmanan)
  • Loading branch information
brammool committed May 29, 2016
1 parent b127cfd commit ef3abc6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
33 changes: 14 additions & 19 deletions src/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down
1 change: 0 additions & 1 deletion src/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1859,
/**/
1858,
/**/
Expand Down

0 comments on commit ef3abc6

Please sign in to comment.