src/nvim/eval/funcs.c
// "expandcmd()" function
// Expand all the special characters in a command string.
"expandcmd()" function
Expand all the special characters in a command string.
" expandcmd () " function Expand all the special characters in a command string .
static void f_expandcmd(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
  char_u *errormsg = NULL;
  rettv->v_type = VAR_STRING;
  char_u *cmdstr = (char_u *)xstrdup(tv_get_string(&argvars[0]));
  exarg_T eap = {
    .cmd = cmdstr,
    .arg = cmdstr,
    .usefilter = false,
    .nextcmd = NULL,
    .cmdidx = CMD_USER,
  };
  eap.argt |= NOSPC;
  expand_filename(&eap, &cmdstr, &errormsg);
  if (errormsg != NULL && *errormsg != NUL) {
    EMSG(errormsg);
  }
  rettv->vval.v_string = cmdstr;
}
static void f_expandcmd ( typval_T * argvars , typval_T * rettv , FunPtr fptr ) { char_u * errormsg = NULL ; rettv -> v_type = VAR_STRING ; char_u * cmdstr = ( char_u * ) xstrdup ( tv_get_string ( & argvars [ 0 ] ) ) ; exarg_T eap = { . cmd = cmdstr , . arg = cmdstr , . usefilter = false , . nextcmd = NULL , . cmdidx = CMD_USER , } ; eap . argt |= NOSPC ; expand_filename ( & eap , & cmdstr , & errormsg ) ; if ( errormsg != NULL && * errormsg != NUL ) { EMSG ( errormsg ) ; } rettv -> vval . v_string = cmdstr ; }
"expandcmd()" function
Expand all the special characters in a command string.
" expandcmd () " function Expand all the special characters in a command string .