(scan_lists): Follow coding convention.
[bpt/emacs.git] / src / w32proc.c
index 8c99a0a..fbb4030 100644 (file)
@@ -1,12 +1,12 @@
 /* Process support for GNU Emacs on the Microsoft W32 API.
    Copyright (C) 1992, 1995, 1999, 2000, 2001, 2002, 2003, 2004,
-                2005, 2006, 2007 Free Software Foundation, Inc.
+                2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -55,6 +55,7 @@ extern BOOL WINAPI IsValidLocale(LCID, DWORD);
 #endif
 
 #include "lisp.h"
+#include "character.h"
 #include "w32.h"
 #include "w32heap.h"
 #include "systime.h"
@@ -216,12 +217,18 @@ delete_child (child_process *cp)
          /* let the thread exit cleanly if possible */
          cp->status = STATUS_READ_ERROR;
          SetEvent (cp->char_consumed);
+#if 0
+          /* We used to forceably terminate the thread here, but it
+             is normally unnecessary, and in abnormal cases, the worst that
+             will happen is we have an extra idle thread hanging around
+             waiting for the zombie process.  */
          if (WaitForSingleObject (cp->thrd, 1000) != WAIT_OBJECT_0)
            {
              DebPrint (("delete_child.WaitForSingleObject (thread) failed "
                         "with %lu for fd %ld\n", GetLastError (), cp->fd));
              TerminateThread (cp->thrd, 0);
            }
+#endif
        }
       CloseHandle (cp->thrd);
       cp->thrd = NULL;
@@ -775,7 +782,14 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp)
      variable in their environment.  */
   char ppid_env_var_buffer[64];
   char *extra_env[] = {ppid_env_var_buffer, NULL};
-  char *sepchars = " \t";
+  /* These are the characters that cause an argument to need quoting.
+     Arguments with whitespace characters need quoting to prevent the
+     argument being split into two or more. Arguments with wildcards
+     are also quoted, for consistency with posix platforms, where wildcards
+     are not expanded if we run the program directly without a shell.
+     Some extra whitespace characters need quoting in Cygwin programs,
+     so this list is conditionally modified below.  */
+  char *sepchars = " \t*?";
 
   /* We don't care about the other modes */
   if (mode != _P_NOWAIT)
@@ -2245,10 +2259,8 @@ If successful, the new layout id is returned, otherwise nil.  */)
 \f
 syms_of_ntproc ()
 {
-  Qhigh = intern ("high");
-  Qlow = intern ("low");
-  staticpro (&Qhigh);
-  staticpro (&Qlow);
+  DEFSYM (Qhigh, "high");
+  DEFSYM (Qlow, "low");
 
 #ifdef HAVE_SOCKETS
   defsubr (&Sw32_has_winsock);