From add36363c1ac31e2e51925e69275c4dbdf26401f Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Thu, 6 Oct 2011 12:35:44 +0000 Subject: w32: use const char * in system() and popen() git-svn-id: svn://tug.org/texlive/trunk@24217 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/ChangeLog | 4 ++++ Build/source/texk/kpathsea/win32lib.c | 8 ++++---- Build/source/texk/kpathsea/win32lib.h | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 6a7144c402d..5680cb3b5ca 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,7 @@ +2011-10-06 Akira Kakuto + + * win32lib.c, win32lib.h: use const char * in system() and popen(). + 2011-09-30 Karl Berry * types.h (kpse_{ris,bltxml}_format): new types. diff --git a/Build/source/texk/kpathsea/win32lib.c b/Build/source/texk/kpathsea/win32lib.c index 0ca0367d466..fd1636436de 100644 --- a/Build/source/texk/kpathsea/win32lib.c +++ b/Build/source/texk/kpathsea/win32lib.c @@ -20,7 +20,7 @@ #include #include -FILE * __cdecl kpathsea_win32_popen (kpathsea kpse, char *cmd, char *mode) +FILE * __cdecl kpathsea_win32_popen (kpathsea kpse, const char *cmd, const char *mode) { STARTUPINFO si; PROCESS_INFORMATION pi; @@ -1075,7 +1075,7 @@ build_cmdline(char ***cmd, char *input, char *output) under Win9x. This is a workaround for this bug. */ -int __cdecl kpathsea_win32_system(kpathsea kpse, char *cmd) +int __cdecl kpathsea_win32_system(kpathsea kpse, const char *cmd) { STARTUPINFO si; PROCESS_INFORMATION pi; @@ -1266,7 +1266,7 @@ int __cdecl kpathsea_win32_system(kpathsea kpse, char *cmd) } #if defined (KPSE_COMPAT_API) -FILE * __cdecl win32_popen (char *cmd, char *mode) +FILE * __cdecl win32_popen (const char *cmd, const char *mode) { return kpathsea_win32_popen(kpse_def, cmd, mode); } @@ -1315,7 +1315,7 @@ getpwnam (char *name) return kpathsea_getpwnam (kpse_def, name); } -int __cdecl win32_system(char *cmd) +int __cdecl win32_system(const char *cmd) { return kpathsea_win32_system (kpse_def, cmd); } diff --git a/Build/source/texk/kpathsea/win32lib.h b/Build/source/texk/kpathsea/win32lib.h index a613339712d..8aac50c8592 100644 --- a/Build/source/texk/kpathsea/win32lib.h +++ b/Build/source/texk/kpathsea/win32lib.h @@ -247,10 +247,10 @@ #undef min #endif -extern KPSEDLL FILE *kpathsea_win32_popen (kpathsea kpse, char *cmd, char *mode); +extern KPSEDLL FILE *kpathsea_win32_popen (kpathsea kpse, const char *cmd, const char *mode); extern KPSEDLL int kpathsea_win32_pclose (kpathsea kpse, FILE *f); extern KPSEDLL struct passwd *kpathsea_getpwnam (kpathsea kpse, char *name); -extern KPSEDLL int kpathsea_win32_system(kpathsea kpse, char *cmd); +extern KPSEDLL int kpathsea_win32_system(kpathsea kpse, const char *cmd); #if defined (KPSE_COMPAT_API) extern KPSEDLL struct passwd *getpwnam (char *name); @@ -259,9 +259,9 @@ extern KPSEDLL struct passwd *getpwnam (char *name); #define popen(cmd, mode) win32_popen(cmd, mode) #define pclose(file) win32_pclose(file) /* Functions for WIN32 */ -extern KPSEDLL FILE *popen(char * str, char * str2); +extern KPSEDLL FILE *popen(const char * str, const char * str2); extern KPSEDLL int pclose(FILE * f); -extern KPSEDLL int system(char * cmd); +extern KPSEDLL int system(const char * cmd); #endif /* KPSE_COMPAT_API */ extern KPSEDLL void xfseek64 (FILE *f, __int64 offset, int wherefrom, const char *fname); -- cgit v1.2.3