patch 7.4.1506
Problem: Job cannot read from a file.
Solution: Implement reading from a file for Unix.
diff --git a/src/os_win32.c b/src/os_win32.c
index 42e8672..9201b34 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -5000,6 +5000,7 @@
HANDLE jo;
# ifdef FEAT_CHANNEL
channel_T *channel;
+ int use_file_for_in = options->jo_io[PART_IN] == JIO_FILE;
int use_out_for_err = options->jo_io[PART_ERR] == JIO_OUT;
HANDLE ifd[2];
HANDLE ofd[2];
@@ -5035,13 +5036,25 @@
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
- if (!CreatePipe(&ifd[0], &ifd[1], &saAttr, 0)
- || !pSetHandleInformation(ifd[1], HANDLE_FLAG_INHERIT, 0)
- || !CreatePipe(&ofd[0], &ofd[1], &saAttr, 0)
- || !pSetHandleInformation(ofd[0], HANDLE_FLAG_INHERIT, 0)
- || (!use_out_for_err
+ if (use_file_for_in)
+ {
+ char_u *fname = options->jo_io_name[PART_IN];
+
+ // TODO
+ EMSG2(_(e_notopen), fname);
+ goto failed;
+ }
+ else if (!CreatePipe(&ifd[0], &ifd[1], &saAttr, 0)
+ || !pSetHandleInformation(ifd[1], HANDLE_FLAG_INHERIT, 0))
+ goto failed;
+
+ if (!CreatePipe(&ofd[0], &ofd[1], &saAttr, 0)
+ || !pSetHandleInformation(ofd[0], HANDLE_FLAG_INHERIT, 0))
+ goto failed;
+
+ if (!use_out_for_err
&& (!CreatePipe(&efd[0], &efd[1], &saAttr, 0)
- || !pSetHandleInformation(efd[0], HANDLE_FLAG_INHERIT, 0))))
+ || !pSetHandleInformation(efd[0], HANDLE_FLAG_INHERIT, 0)))
goto failed;
si.dwFlags |= STARTF_USESTDHANDLES;
si.hStdInput = ifd[0];