diff options
| author | ZyX <kp-pav@yandex.ru> | 2016-08-28 09:15:28 +0300 | 
|---|---|---|
| committer | ZyX <kp-pav@yandex.ru> | 2017-03-29 10:08:05 +0300 | 
| commit | 50ebd1dff5c4e995c4f7e7980870e43d9defabc6 (patch) | |
| tree | 391ae8a9e6980f990d15f3c77d582629b840a549 /src/nvim/quickfix.c | |
| parent | 233b0c93bba66492d7b8b61f8ac61082f03668a1 (diff) | |
| download | rneovim-50ebd1dff5c4e995c4f7e7980870e43d9defabc6.tar.gz rneovim-50ebd1dff5c4e995c4f7e7980870e43d9defabc6.tar.bz2 rneovim-50ebd1dff5c4e995c4f7e7980870e43d9defabc6.zip | |
eval: Move free_tv to eval/typval.h, remove most of its usages
Diffstat (limited to 'src/nvim/quickfix.c')
| -rw-r--r-- | src/nvim/quickfix.c | 13 | 
1 files changed, 6 insertions, 7 deletions
| diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 06ac2821b0..4fa5c85abd 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -4372,7 +4372,6 @@ void ex_cbuffer(exarg_T *eap)   */  void ex_cexpr(exarg_T *eap)  { -  typval_T *tv;    qf_info_T *qi = &ql_info;    const char *au_name = NULL; @@ -4412,11 +4411,11 @@ void ex_cexpr(exarg_T *eap)    /* Evaluate the expression.  When the result is a string or a list we can     * use it to fill the errorlist. */ -  tv = eval_expr(eap->arg, NULL); -  if (tv != NULL) { -    if ((tv->v_type == VAR_STRING && tv->vval.v_string != NULL) -        || (tv->v_type == VAR_LIST && tv->vval.v_list != NULL)) { -      if (qf_init_ext(qi, NULL, NULL, tv, p_efm, +  typval_T tv; +  if (eval0(eap->arg, &tv, NULL, true) != FAIL) { +    if ((tv.v_type == VAR_STRING && tv.vval.v_string != NULL) +        || (tv.v_type == VAR_LIST && tv.vval.v_list != NULL)) { +      if (qf_init_ext(qi, NULL, NULL, &tv, p_efm,                        (eap->cmdidx != CMD_caddexpr                         && eap->cmdidx != CMD_laddexpr),                        (linenr_T)0, (linenr_T)0, *eap->cmdlinep) > 0) { @@ -4431,7 +4430,7 @@ void ex_cexpr(exarg_T *eap)      } else {        EMSG(_("E777: String or List expected"));      } -    free_tv(tv); +    tv_clear(&tv);    }  } | 
