From: Johannes Sixt Date: Tue, 17 Apr 2012 14:00:25 GMT Subject: Re: [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows Message-ID: <4F8D7779.9080506@viscovery.net> In-Reply-To: <1334670128-sup-4966@pinkfloyd.chass.utoronto.ca> Am 4/17/2012 15:45, schrieb Ben Walton: > Excerpts from Johannes Sixt's message of Tue Apr 17 03:03:21 -0400 2012: >> The recent change to use SHELL_PATH instead of "sh" to spawn shell >> commands is not suited for Windows: > > Ah yes, I can see how that would be undesirable on Windows. > >> +#ifndef WIN32 >> nargv[nargc++] = SHELL_PATH; >> +#else >> + nargv[nargc++] = "sh"; >> +#endif >> nargv[nargc++] = "-c"; > > A minor style question: Would this conditional code not be better if > it were up where the fallback SHELL_PATH is set? That would leave > this code block #ifdef free while still avoiding the breakage on > Windows. It would require either to #define yet another new name to SHELL_PATH or "sh", or to #undef SHELL_PATH and re#define it for WIN32. Neither is very appealing. I personally prefer to have the conditional (if it is as short as this one) at the point where it matters. -- Hannes