diff options
author | wlemb <wlemb> | 2004-02-22 09:00:34 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2004-02-22 09:00:34 +0000 |
commit | 0ca21c8d6c4931abca01f669e3215b7952827f2a (patch) | |
tree | ce49870ee7c7be932086e71e0d9a693d36621090 /src/include | |
parent | d63903bb009a281dc1379733417c5cc0ce658446 (diff) | |
download | groff-0ca21c8d6c4931abca01f669e3215b7952827f2a.tar.gz |
* src/libs/libgroff/quotearg.c: New file, providing proper argument
quoting for MSVC's spawn* and exec* functions.
* src/libs/libgroff/spawnvp.c: New file, providing a wrapper around
spawnvp with proper quoting for MSVC.
* src/libs/libgroff/assert.cpp (program_name),
src/libs/libgroff/new.cpp (program_name): Declare as `extern "C"'.
* src/libs/libgroff/Makefile.sub (OBJS, CSRCS): Updated.
* src/roff/troff/input.cpp (program_name): Declare as `extern "C"'.
* src/include/error.h (program_name): Declare as `extern "C"'.
* src/include/nonposix.h [__MSDOS__ ...]: Handle spawnvp.
* src/preproc/html/pre-html.cpp [__CYGWIN__ ...]: Declare
spawnvp_wrapper.
[MAY_SPAWN_ASYNCHRONOUS_CHILD]: Declare i and j.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/error.h | 5 | ||||
-rw-r--r-- | src/include/nonposix.h | 11 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/include/error.h b/src/include/error.h index e227682b..6910e550 100644 --- a/src/include/error.h +++ b/src/include/error.h @@ -1,5 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2003, 2004 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -52,7 +53,7 @@ extern void warning(const char *, const errarg &arg3 = empty_errarg); -extern const char *program_name; +extern "C" const char *program_name; extern int current_lineno; extern const char *current_filename; extern const char *current_source_filename; diff --git a/src/include/nonposix.h b/src/include/nonposix.h index 25a7b54e..dfbe6d0a 100644 --- a/src/include/nonposix.h +++ b/src/include/nonposix.h @@ -60,6 +60,16 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # define creat(p,m) _creat(p,m) # define read(f,b,s) _read(f,b,s) # define isatty(f) _isatty(f) + +/* Workaround for broken argument parsing + in child process invoked through MSVC `spawnvp()' function. */ +# ifndef SPAWNVP_C +# undef spawnvp +# define spawnvp spawnvp_wrapper +# undef _spawnvp +# define _spawnvp spawnvp +# endif + # endif # define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0) # define FOPEN_RB "rb" @@ -116,6 +126,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ const char * system_shell_name(void); const char * system_shell_dash_c(void); int is_system_shell(const char *); + int spawnvp_wrapper(int, char *, char **); # ifdef __cplusplus } # endif |