summaryrefslogtreecommitdiff
path: root/Build/source/texk/ptexenc/ptexenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/ptexenc/ptexenc.c')
-rw-r--r--Build/source/texk/ptexenc/ptexenc.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/Build/source/texk/ptexenc/ptexenc.c b/Build/source/texk/ptexenc/ptexenc.c
index 4c1d6acc11d..b492876c081 100644
--- a/Build/source/texk/ptexenc/ptexenc.c
+++ b/Build/source/texk/ptexenc/ptexenc.c
@@ -711,6 +711,7 @@ long input_line2(FILE *fp, unsigned char *buff, long pos,
const int fd = fileno(fp);
if (infile_enc[fd] == ENC_UNKNOWN) { /* just after opened */
+ ungetbuff[fd].size = 0;
if (isUTF8Nstream(fp)) infile_enc[fd] = ENC_UTF8;
else infile_enc[fd] = get_file_enc();
}
@@ -776,14 +777,6 @@ long input_line2(FILE *fp, unsigned char *buff, long pos,
if (i == EOF || i == '\n' || i == '\r') injis = false;
if (lastchar != NULL) *lastchar = i;
- if (i == '\r' && !isatty(fd)) {
- int ii;
- while ((ii = getc4(fp)) == EOF && errno == EINTR)
- ;
- if (ii != '\n')
- ungetc4(ii, fp);
- }
-
return last;
}