From 7752da13b2169a08137039744472ebb2ff56e8d9 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Fri, 10 Aug 2012 05:28:58 +0000 Subject: use rewind(f) instead of fseek(f,0,SEEK_SET) git-svn-id: svn://tug.org/texlive/trunk@27359 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/xetexdir/ChangeLog | 5 +++++ Build/source/texk/web2c/xetexdir/XeTeX_ext.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog index ef95fb7c230..d8deac55812 100644 --- a/Build/source/texk/web2c/xetexdir/ChangeLog +++ b/Build/source/texk/web2c/xetexdir/ChangeLog @@ -1,3 +1,8 @@ +2012-08-09 Akira Kakuto + + * XeTeX_ext.c: use rewind(f) instead of fseek(f, 0, SEEK_SET) + in u_open_in() in order to work also on W32. + 2012-08-09 Akira Kakuto * XeTeXFontMgr.cpp: Add 'extern "C" {' to avoid link error in MSVC. diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c index f0d0023222a..c6b1e420583 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c +++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c @@ -2946,11 +2946,11 @@ u_open_in(unicodefile* f, integer filefmt, const_string fopen_mode, integer mode mode = UTF16LE; else if (B1 == 0 && B2 != 0) { mode = UTF16BE; - fseek((*f)->f, SEEK_SET, 0); + rewind((*f)->f); } else if (B2 == 0 && B1 != 0) { mode = UTF16LE; - fseek((*f)->f, SEEK_SET, 0); + rewind((*f)->f); } else if (B1 == 0xef && B2 == 0xbb) { int B3 = getc((*f)->f); @@ -2958,7 +2958,7 @@ u_open_in(unicodefile* f, integer filefmt, const_string fopen_mode, integer mode mode = UTF8; } if (mode == AUTO) { - fseek((*f)->f, SEEK_SET, 0); + rewind((*f)->f); mode = UTF8; } } -- cgit v1.2.3