* dcrt0.cc (quoted): Fix problem where ' quoted strings were skipped.

* fhandler.h (fhandler_socket::~fhandler_socket): Delete declaration.
* net.cc: Remove unnecessary "number_of_sockets" usage.
(fhandler_socket::fhandler_socket): Ditto.
(fhandler_socket::~fhandler_socket): Delete definition.
* spawn.cc (spawn_guts): Force first argument passed to CreateProcess as a
command line to be windows style.
This commit is contained in:
Christopher Faylor 2000-09-26 00:52:21 +00:00
parent ef42416e99
commit 4eafa56ec2
5 changed files with 15 additions and 22 deletions

View File

@ -1,3 +1,13 @@
Mon Sep 25 20:47:04 2000 Christopher Faylor <cgf@cygnus.com>
* dcrt0.cc (quoted): Fix problem where ' quoted strings were skipped.
* fhandler.h (fhandler_socket::~fhandler_socket): Delete declaration.
* net.cc: Remove unnecessary "number_of_sockets" usage.
(fhandler_socket::fhandler_socket): Ditto.
(fhandler_socket::~fhandler_socket): Delete definition.
* spawn.cc (spawn_guts): Force first argument passed to CreateProcess
as a command line to be windows style.
2000-09-25 Christopher Faylor <cgf@cygnus.com> 2000-09-25 Christopher Faylor <cgf@cygnus.com>
* spawn.cc (av::dup_maybe): Make function void rather than void *. * spawn.cc (av::dup_maybe): Make function void rather than void *.

View File

@ -312,19 +312,18 @@ quoted (char *cmd, int winshell)
return p; return p;
} }
const char *s = quote == '\'' ? "'" : "\\\"";
/* This must have been run from a Windows shell, so preserve /* This must have been run from a Windows shell, so preserve
quotes for globify to play with later. */ quotes for globify to play with later. */
while (*++cmd) while (*cmd && *++cmd)
if ((p = strpbrk (cmd, "\\\"")) == NULL) if ((p = strpbrk (cmd, s)) == NULL)
{ {
cmd = strchr (cmd, '\0'); // no closing quote cmd = strchr (cmd, '\0'); // no closing quote
break; break;
} }
else if (quote == '\'')
continue;
else if (*p == '\\') else if (*p == '\\')
cmd = ++p; cmd = ++p;
else if (p[1] == quote) else if (quote == '"' && p[1] == '"')
{ {
*p = '\\'; *p = '\\';
cmd = ++p; // a quoted quote cmd = ++p; // a quoted quote

View File

@ -314,7 +314,6 @@ private:
public: public:
fhandler_socket (const char *name = 0); fhandler_socket (const char *name = 0);
fhandler_socket (unsigned int, const char *name = 0); fhandler_socket (unsigned int, const char *name = 0);
~fhandler_socket ();
int get_socket () const { return (int) get_handle(); } int get_socket () const { return (int) get_handle(); }
fhandler_socket * is_socket () { return this; } fhandler_socket * is_socket () { return this; }
int write (const void *ptr, size_t len); int write (const void *ptr, size_t len);

View File

@ -33,11 +33,6 @@ details. */
#include "pinfo.h" #include "pinfo.h"
#include "registry.h" #include "registry.h"
/* We only want to initialize WinSock in a child process if socket
handles are inheritted. This global allows us to know whether this
should be done or not */
int number_of_sockets = 0;
extern "C" extern "C"
{ {
int h_errno; int h_errno;
@ -1584,7 +1579,6 @@ fhandler_socket::fhandler_socket (const char *name) :
fhandler_base (FH_SOCKET, name) fhandler_base (FH_SOCKET, name)
{ {
set_cb (sizeof *this); set_cb (sizeof *this);
number_of_sockets++;
} }
/* sethostent: standards? */ /* sethostent: standards? */
@ -1601,15 +1595,6 @@ endhostent (void)
{ {
} }
fhandler_socket::~fhandler_socket ()
{
if (--number_of_sockets < 0)
{
number_of_sockets = 0;
system_printf("socket count < 0");
}
}
int int
fhandler_socket::read (void *ptr, size_t len) fhandler_socket::read (void *ptr, size_t len)
{ {

View File

@ -496,7 +496,7 @@ spawn_guts (HANDLE hToken, const char * prog_arg, const char *const *argv,
const char *a; const char *a;
newargv.dup_maybe (i); newargv.dup_maybe (i);
a = newargv[i]; a = i ? newargv[i] : (char *) real_path;
int len = strlen (a); int len = strlen (a);
if (len != 0 && !strpbrk (a, " \t\n\r\"")) if (len != 0 && !strpbrk (a, " \t\n\r\""))
one_line.add (a, len); one_line.add (a, len);