summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog4
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c12
2 files changed, 12 insertions, 4 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index d9925dc6ff9..149b3660e15 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,7 @@
+2011-10-11 Peter Breitenlohner <peb@mp.mpg.de>
+
+ * texmfmp.c [WIN32]: Slightly reformulate Byte order marks.
+
2011-10-07 Peter Breitenlohner <peb@mp.mpg.de>
* texmfmp.c: More changes to reduce diffs with W32TeX.
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 9f2f8807433..f3682cfbb6d 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -2086,7 +2086,7 @@ input_line (FILE *f)
if (f != Poptr && fileno (f) != fileno (stdin)) {
long position = ftell (f);
- if (position == 0L) {
+ if (position == 0L) { /* Detect and skip Byte order marks. */
int k1 = getc (f);
if (k1 == EOF || k1 == '\r' || k1 == '\n')
@@ -2096,11 +2096,15 @@ input_line (FILE *f)
if (k2 == EOF || k2 == '\r' || k2 == '\n')
fseek (f, -2L , SEEK_CUR);
- else if (!(k1 == 0xff && k2 == 0xfe) &&
- !(k1 == 0xfe && k2 == 0xff)) {
+ else if ((k1 == 0xff && k2 == 0xfe) || /* UTF-16(LE) */
+ (k1 == 0xfe && k2 == 0xff)) /* UTF-16(BE) */
+ ;
+ else {
int k3 = getc (f);
- if (!(k1 == 0xef && k2 == 0xbb && k3 == 0xbf))
+ if (k1 == 0xef && k2 == 0xbb && k3 == 0xbf) /* UTF-8 */
+ ;
+ else
fseek (f, -3L, SEEK_CUR);
}
}