diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2012-08-06 01:01:07 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2012-08-06 01:01:07 +0000 |
commit | cc7d390bf962c0b4b9449006ac2f1bb4293a67c0 (patch) | |
tree | 8d790aeb9677566341d09e0ae144ec9cd9ae6263 | |
parent | 8ec4e52d41c6bd3b936d2c1f15ebb00853368f4d (diff) |
W32 bug fix
git-svn-id: svn://tug.org/texlive/trunk@27314 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/web2c/lib/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index 7065998bf90..dfd07c9260d 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,3 +1,8 @@ +2012-08-06 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * texmfmp.c [WIN32]: bug fix. use rewind (f) to clear error and + EOF indicators. + 2012-07-23 Peter Breitenlohner <peb@mppmu.mpg.de> * texmfmp.c (runpopen): Binary mode for popen() on Windows now diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 8460479d292..d53577c424b 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -2074,13 +2074,13 @@ input_line (FILE *f) if (position == 0L) { /* Detect and skip Byte order marks. */ int k1 = getc (f); - if (k1 == EOF || k1 == '\r' || k1 == '\n') - fseek (f, -1L , SEEK_CUR); + if (k1 != 0xff && k1 != 0xfe && k1 != 0xef) + rewind (f); else { int k2 = getc (f); - if (k2 == EOF || k2 == '\r' || k2 == '\n') - fseek (f, -2L , SEEK_CUR); + if (k2 != 0xff && k2 != 0xfe && k2 != 0xbb) + rewind (f); else if ((k1 == 0xff && k2 == 0xfe) || /* UTF-16(LE) */ (k1 == 0xfe && k2 == 0xff)) /* UTF-16(BE) */ ; @@ -2090,7 +2090,7 @@ input_line (FILE *f) if (k1 == 0xef && k2 == 0xbb && k3 == 0xbf) /* UTF-8 */ ; else - fseek (f, -3L, SEEK_CUR); + rewind (f); } } } |