diff options
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/mendexk/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/mendexk/fread.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Build/source/texk/mendexk/ChangeLog b/Build/source/texk/mendexk/ChangeLog index 7227d6ebb22..65d0b948642 100644 --- a/Build/source/texk/mendexk/ChangeLog +++ b/Build/source/texk/mendexk/ChangeLog @@ -1,3 +1,8 @@ +2013-11-15 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * fread.c: Discard the final '\n' in DOS line endings in mfgets(), + because dictionary files with DOS line endings can't be read. + 2013-09-10 Peter Breitenlohner <peb@mppmu.mpg.de> * fwrite.c: Bug fix as suggested by Akira, Karl, and Norbert. diff --git a/Build/source/texk/mendexk/fread.c b/Build/source/texk/mendexk/fread.c index 0ae9151ffb1..8a1e5559f6d 100644 --- a/Build/source/texk/mendexk/fread.c +++ b/Build/source/texk/mendexk/fread.c @@ -523,6 +523,11 @@ char *mfgets(char *buf, int size, FILE *fp) int c, len; if ((len = input_line2(fp, (unsigned char *) buf, 0, size, &c)) == 0) return NULL; + if (c == '\r') { + int cc = getc(fp); + if (cc != '\n') + ungetc(cc, fp); + } if (c == '\n' || c == '\r') { if (len+1 < size) strcat(buf+len, "\n"); else ungetc(c, fp); |