From 66eaf280ac52dbda8c75fb326a36b24fb02ca008 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 5 Apr 2009 04:23:50 +0000 Subject: [PATCH] * net.cc: Undefine NOERROR and DELETE to avoid compiler warnings. * shared_info.h (CURR_SHARED_MAGIC): Update. * spawn.cc (spawn_guts): Avoid copying one line command line argument if it hasn't been filled out. --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/net.cc | 6 ++++++ winsup/cygwin/shared_info.h | 2 +- winsup/cygwin/spawn.cc | 5 ++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f3f77e566..e05d959fc 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2009-04-05 Christopher Faylor + + * net.cc: Undefine NOERROR and DELETE to avoid compiler warnings. + * shared_info.h (CURR_SHARED_MAGIC): Update. + * spawn.cc (spawn_guts): Avoid copying one line command line argument + if it hasn't been filled out. + 2009-04-04 Yaakov Selkowitz Corinna Vinschen diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 4ea6ffedf..cb0a5cdf4 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -14,6 +14,12 @@ details. */ #define __INSIDE_CYGWIN_NET__ #include "winsup.h" + +/* unfortunately defined in windows header file but used in + cygwin header files too */ +#undef NOERROR +#undef DELETE + #include "miscfuncs.h" #include #include diff --git a/winsup/cygwin/shared_info.h b/winsup/cygwin/shared_info.h index e332829df..bf4be4e2b 100644 --- a/winsup/cygwin/shared_info.h +++ b/winsup/cygwin/shared_info.h @@ -31,7 +31,7 @@ public: #define SHARED_INFO_CB 39328 -#define CURR_SHARED_MAGIC 0x22f9ff0bU +#define CURR_SHARED_MAGIC 0x398d8baU #define USER_VERSION 1 // increment when mount table changes and #define USER_VERSION_MAGIC CYGWIN_VERSION_MAGIC (USER_MAGIC, USER_VERSION) diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index cd80e1833..a95727880 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -417,7 +417,10 @@ spawn_guts (const char *prog_arg, const char *const *argv, VerifyHandle (moreinfo->myself_pinfo); } WCHAR wone_line[one_line.ix + 1]; - sys_mbstowcs (wone_line, one_line.ix + 1, one_line.buf); + if (one_line.ix) + sys_mbstowcs (wone_line, one_line.ix + 1, one_line.buf); + else + wone_line[0] = L'\0'; PROCESS_INFORMATION pi; pi.hProcess = pi.hThread = NULL;