summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2014-01-14 06:27:11 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2014-01-14 06:27:11 +0000
commit9fa91bdf68803aecb3477b67d63632bfea37ad84 (patch)
treea759609c1dcdd5762ced9aa777089a01858a3119 /Build
parent58b77341b2ac292f26c7c3049f0feb9136d09cb3 (diff)
Add new functions fsyscp_spawnvp(), and fsyscp_system(). (Windows only)
git-svn-id: svn://tug.org/texlive/trunk@32670 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/kpathsea/knj.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/Build/source/texk/kpathsea/knj.c b/Build/source/texk/kpathsea/knj.c
index 0d3eb0ec04e..174256a915c 100644
--- a/Build/source/texk/kpathsea/knj.c
+++ b/Build/source/texk/kpathsea/knj.c
@@ -192,7 +192,9 @@ fsyscp_popen (const char *command, const char *mode)
}
}
#endif
- free(commandw);
+ free (commandw);
+/* We use always binary mode on Windows */
+ if(f) _setmode (fileno (f), _O_BINARY);
return f;
}
@@ -249,9 +251,7 @@ fsyscp_spawnvp (int mode, const char *command, const char* const *argv)
wchar_t *commandw, **argvw, **pw;
int i;
const char* const *p;
-#if defined (KPSE_COMPAT_API)
- kpathsea kpse;
-#endif
+
assert(command && argv);
for (i = 0, p = argv; *p; p++)
i++;
@@ -266,18 +266,6 @@ fsyscp_spawnvp (int mode, const char *command, const char* const *argv)
}
*pw = NULL;
ret = _wspawnvp (mode, (const wchar_t *)commandw, (const wchar_t* const*) argvw);
-#if defined (KPSE_COMPAT_API)
- if (ret == -1) {
- kpse = kpse_def;
- if (KPATHSEA_DEBUG_P (KPSE_DEBUG_FOPEN)) {
- DEBUGF_START ();
- fprintf (stderr, "fsyscp_spawnvp(%s [", command);
- WriteConsoleW( GetStdHandle( STD_ERROR_HANDLE ), commandw, wcslen( commandw ), NULL, NULL );
- fprintf (stderr, "]\n");
- DEBUGF_END ();
- }
- }
-#endif
if(commandw) free(commandw);
if (argvw) {
pw = argvw;
@@ -291,7 +279,8 @@ fsyscp_spawnvp (int mode, const char *command, const char* const *argv)
return ret;
}
-static int is_include_space (const char *s)
+static
+int is_include_space (const char *s)
{
char *p;
p = strchr (s, ' ');