From 683d334a8b977edac65c501ea577a4e77ca26749 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Thu, 14 Apr 2016 13:38:14 +0000 Subject: Fix a bug to show input file name in the case of pipe input. Reported by Enrico Gregorio. git-svn-id: svn://tug.org/texlive/trunk@40504 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/lib/ChangeLog | 6 ++++++ Build/source/texk/web2c/lib/texmfmp.c | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'Build') diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index fcd4fe64814..7a8ede7b015 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,3 +1,9 @@ +2016-04-14 Akira Kakuto + + * texmfmp.c: Fix a bug to show input file name in the case of pipe input. + Reported by Enrico Gregorio: + http://tug.org/pipermail/tex-live/2016-April/038030.html + 2016-03-22 Karl Berry * texmfmp.c: no uexit after FATAL. diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index fae82477b93..a391445d0fa 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -2030,6 +2030,9 @@ open_in_or_pipe (FILE **f_ptr, int filefmt, const_string fopen_mode) *f_ptr = NULL; fname = xmalloc(strlen((const_string)(nameoffile+1))+1); strcpy(fname,(const_string)(nameoffile+1)); + if (fullnameoffile) + free(fullnameoffile); + fullnameoffile = xstrdup(fname); recorder_record_input (fname + 1); *f_ptr = runpopen(fname+1,"r"); free(fname); @@ -2072,6 +2075,9 @@ u_open_in_or_pipe(unicodefile* f, integer filefmt, const_string fopen_mode, inte (*f)->f = NULL; fname = xmalloc(strlen((const_string)(nameoffile+1))+1); strcpy(fname,(const_string)(nameoffile+1)); + if (fullnameoffile) + free(fullnameoffile); + fullnameoffile = xstrdup(fname); recorder_record_input (fname + 1); (*f)->f = runpopen(fname+1,"r"); free(fname); -- cgit v1.2.3