summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2012-10-13 14:34:01 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2012-10-13 14:34:01 +0000
commit0de3d5e820cc6cb2ad85046ced520a61e5c0ca3f (patch)
tree5fd756a2795e48218f23cf7fbaed3ee481d71560
parentd4a4b56d69cc3b69836de6c6968d53dcec135a66 (diff)
input by pipe was impossible in luatex. enable it.
git-svn-id: svn://tug.org/texlive/trunk@27960 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texfileio.w18
2 files changed, 14 insertions, 8 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index 0178a9b4d3d..c19aa6fcafa 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,7 @@
+2012-10-13 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
+
+ * tex/texfileio.w: input by pipe was impossible. enable it.
+
2012-10-11 Peter Breitenlohner <peb@mppmu.mpg.de>
* lua/luainit.w (lua_initialize): Free two malloc()ed strings.
diff --git a/Build/source/texk/web2c/luatexdir/tex/texfileio.w b/Build/source/texk/web2c/luatexdir/tex/texfileio.w
index 201c78dea41..4607e3ec7cd 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texfileio.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texfileio.w
@@ -291,7 +291,10 @@ boolean lua_a_open_in(alpha_file * f, char *fn, int n)
} else {
read_file_callback_id[n] = 0;
}
- fnam = luatex_find_read_file(fn, n, find_read_file_callback);
+ if (*fn == '|')
+ fnam = fn;
+ else
+ fnam = luatex_find_read_file(fn, n, find_read_file_callback);
if (!fnam)
return false;
callback_id = callback_defined(open_read_file_callback);
@@ -1266,9 +1269,8 @@ static FILE *runpopen(char *cmd, const char *mode)
closed using |pclose()|.
@c
-static FILE *pipes[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-};
+#define NUM_PIPES 16
+static FILE *pipes[NUM_PIPES];
#ifdef WIN32
FILE *Poptr;
@@ -1295,14 +1297,14 @@ boolean open_in_or_pipe(FILE ** f_ptr, char *fn, int filefmt,
recorder_record_input(fname + 1);
*f_ptr = runpopen(fname + 1, "r");
free(fname);
- for (i = 0; i <= 15; i++) {
+ for (i = 0; i < NUM_PIPES; i++) {
if (pipes[i] == NULL) {
pipes[i] = *f_ptr;
break;
}
}
if (*f_ptr)
- setvbuf(*f_ptr, (char *) NULL, _IOLBF, 0);
+ setvbuf(*f_ptr, (char *) NULL, _IONBF, 0);
#ifdef WIN32
Poptr = *f_ptr;
#endif
@@ -1342,7 +1344,7 @@ boolean open_out_or_pipe(FILE ** f_ptr, char *fn, const_string fopen_mode)
recorder_record_output(fname + 1);
free(fname);
- for (i = 0; i <= 15; i++) {
+ for (i = 0; i < NUM_PIPES; i++) {
if (pipes[i] == NULL) {
pipes[i] = *f_ptr;
break;
@@ -1350,7 +1352,7 @@ boolean open_out_or_pipe(FILE ** f_ptr, char *fn, const_string fopen_mode)
}
if (*f_ptr)
- setvbuf(*f_ptr, (char *) NULL, _IOLBF, 0);
+ setvbuf(*f_ptr, (char *) NULL, _IONBF, 0);
return *f_ptr != NULL;
}