comparison src/channel.c @ 12043:2796a2c9fc17 v8.0.0902

patch 8.0.0902: cannot specify directory or environment for a job commit https://github.com/vim/vim/commit/05aafed54b50b602315ae55d83a7d089804cecb0 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 11 19:12:11 2017 +0200 patch 8.0.0902: cannot specify directory or environment for a job Problem: Cannot specify directory or environment for a job. Solution: Add the "cwd" and "env" arguments to job options. (Yasuhiro Matsumoto, closes #1160)
author Christian Brabandt <cb@256bit.org>
date Fri, 11 Aug 2017 19:15:04 +0200
parents 85f0f557661e
children 0498547dace0
comparison
equal deleted inserted replaced
12042:3b09a43a3830 12043:2796a2c9fc17
4151 func_unref(opt->jo_close_cb); 4151 func_unref(opt->jo_close_cb);
4152 if (opt->jo_exit_partial != NULL) 4152 if (opt->jo_exit_partial != NULL)
4153 partial_unref(opt->jo_exit_partial); 4153 partial_unref(opt->jo_exit_partial);
4154 else if (opt->jo_exit_cb != NULL) 4154 else if (opt->jo_exit_cb != NULL)
4155 func_unref(opt->jo_exit_cb); 4155 func_unref(opt->jo_exit_cb);
4156 if (opt->jo_env != NULL)
4157 dict_unref(opt->jo_env);
4156 } 4158 }
4157 4159
4158 /* 4160 /*
4159 * Get the PART_ number from the first character of an option name. 4161 * Get the PART_ number from the first character of an option name.
4160 */ 4162 */
4431 } 4433 }
4432 opt->jo_set2 |= JO2_TERM_FINISH; 4434 opt->jo_set2 |= JO2_TERM_FINISH;
4433 opt->jo_term_finish = *val; 4435 opt->jo_term_finish = *val;
4434 } 4436 }
4435 #endif 4437 #endif
4438 else if (STRCMP(hi->hi_key, "env") == 0)
4439 {
4440 if (!(supported & JO2_ENV))
4441 break;
4442 opt->jo_set |= JO2_ENV;
4443 opt->jo_env = item->vval.v_dict;
4444 ++item->vval.v_dict->dv_refcount;
4445 }
4446 else if (STRCMP(hi->hi_key, "cwd") == 0)
4447 {
4448 if (!(supported & JO2_CWD))
4449 break;
4450 opt->jo_cwd = get_tv_string_buf_chk(item, opt->jo_cwd_buf);
4451 if (opt->jo_cwd == NULL || !mch_isdir(opt->jo_cwd))
4452 {
4453 EMSG2(_(e_invarg2), "cwd");
4454 return FAIL;
4455 }
4456 opt->jo_set |= JO2_CWD;
4457 }
4436 else if (STRCMP(hi->hi_key, "waittime") == 0) 4458 else if (STRCMP(hi->hi_key, "waittime") == 0)
4437 { 4459 {
4438 if (!(supported & JO_WAITTIME)) 4460 if (!(supported & JO_WAITTIME))
4439 break; 4461 break;
4440 opt->jo_set |= JO_WAITTIME; 4462 opt->jo_set |= JO_WAITTIME;