1
0
forked from aniani/vim

patch 7.4.1506

Problem:    Job cannot read from a file.
Solution:   Implement reading from a file for Unix.
This commit is contained in:
Bram Moolenaar
2016-03-06 23:06:25 +01:00
parent d0b6502a7a
commit b69fccf377
5 changed files with 85 additions and 15 deletions

View File

@@ -15118,6 +15118,7 @@ f_job_start(typval_T *argvars UNUSED, typval_T *rettv)
garray_T ga;
#endif
jobopt_T opt;
int part;
rettv->v_type = VAR_JOB;
job = job_alloc();
@@ -15135,6 +15136,17 @@ f_job_start(typval_T *argvars UNUSED, typval_T *rettv)
+ JO_STOPONEXIT + JO_EXIT_CB + JO_OUT_IO) == FAIL)
return;
/* Check that when io is "file" that there is a file name. */
for (part = PART_OUT; part <= PART_IN; ++part)
if ((opt.jo_set & (JO_OUT_IO << (part - PART_OUT)))
&& opt.jo_io[part] == JIO_FILE
&& (!(opt.jo_set & (JO_OUT_NAME << (part - PART_OUT)))
|| *opt.jo_io_name[part] == NUL))
{
EMSG(_("E920: -io file requires -name to be set"));
return;
}
if ((opt.jo_set & JO_IN_IO) && opt.jo_io[PART_IN] == JIO_BUFFER)
{
buf_T *buf;