From 9fa91bdf68803aecb3477b67d63632bfea37ad84 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Tue, 14 Jan 2014 06:27:11 +0000 Subject: Add new functions fsyscp_spawnvp(), and fsyscp_system(). (Windows only) git-svn-id: svn://tug.org/texlive/trunk@32670 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/knj.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'Build/source/texk/kpathsea/knj.c') 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, ' '); -- cgit v1.2.3