summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakuji Tanaka <KXD02663@nifty.ne.jp>2014-01-01 00:27:26 +0000
committerTakuji Tanaka <KXD02663@nifty.ne.jp>2014-01-01 00:27:26 +0000
commit487202a1d0438bdf1ce4eacadd8c254963d095b3 (patch)
treea532f67ed394e015744affc350108b9941d2cbca
parent86eee27b59637d600f33de8a39048a692a234a64 (diff)
Use cast for ASCII string conversion from char to wchar_t (Windows only)
git-svn-id: svn://tug.org/texlive/trunk@32530 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/kpathsea/ChangeLog5
-rw-r--r--Build/source/texk/kpathsea/knj.c8
-rw-r--r--Build/source/texk/kpathsea/knj.h2
3 files changed, 11 insertions, 4 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index ed83500d83d..a8972bffa8e 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,8 @@
+2014-01-01 TANAKA Takuji <KXD02663@nifty.ne.jp>
+
+ * knj.c, knj.h: Use cast for ASCII string conversion
+ from char to wchar_t. (Windows only)
+
2013-12-31 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* knj.h: Remove #include <kpathsea/types.h> because Visual Studio 2010
diff --git a/Build/source/texk/kpathsea/knj.c b/Build/source/texk/kpathsea/knj.c
index 1073c76bbb0..e077aac7ad7 100644
--- a/Build/source/texk/kpathsea/knj.c
+++ b/Build/source/texk/kpathsea/knj.c
@@ -1,7 +1,7 @@
/* knj.c: check for 2-Byte Kanji (CP 932, SJIS) codes.
Copyright 2010, 2011 Akira Kakuto.
- Copyright 2013 TANAKA Takuji.
+ Copyright 2013, 2014 TANAKA Takuji.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -103,13 +103,14 @@ fsyscp_xfopen (const char *filename, const char *mode)
{
FILE *f;
wchar_t *fnamew, modew[4];
+ int i;
#if defined (KPSE_COMPAT_API)
kpathsea kpse;
#endif
assert(filename && mode);
fnamew = get_wstring_from_fsyscp(filename, fnamew=NULL);
- get_wstring_from_fsyscp(mode, modew);
+ for(i=0; modew[i]=(wchar_t)mode[i]; i++) {} /* mode[i] must be ASCII */
f = _wfopen(fnamew, modew);
if (f == NULL)
FATAL_PERROR(filename);
@@ -136,13 +137,14 @@ fsyscp_fopen (const char *filename, const char *mode)
{
FILE *f;
wchar_t *fnamew, modew[4];
+ int i;
#if defined (KPSE_COMPAT_API)
kpathsea kpse;
#endif
assert(filename && mode);
fnamew = get_wstring_from_fsyscp(filename, fnamew=NULL);
- get_wstring_from_fsyscp(mode, modew);
+ for(i=0; modew[i]=(wchar_t)mode[i]; i++) {} /* mode[i] must be ASCII */
f = _wfopen(fnamew, modew);
#if defined (KPSE_COMPAT_API)
if (f != NULL) {
diff --git a/Build/source/texk/kpathsea/knj.h b/Build/source/texk/kpathsea/knj.h
index 7c9e9b6deb8..3bef4e3f90f 100644
--- a/Build/source/texk/kpathsea/knj.h
+++ b/Build/source/texk/kpathsea/knj.h
@@ -1,7 +1,7 @@
/* knj.h: check for 2-Byte Kanji (CP 932, SJIS) codes.
Copyright 2010, 2011 Akira Kakuto.
- Copyright 2013 TANAKA Takuji.
+ Copyright 2013, 2014 TANAKA Takuji.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public