summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/System.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-12-18 18:36:58 (GMT)
committerBrad King <brad.king@kitware.com>2008-12-18 18:36:58 (GMT)
commit0a83aa6f5700b424830136ebd2bf285e8ce6b56d (patch)
tree2b72bf2efbf0412092d64c9e061d9158f072a7c1 /Source/kwsys/System.c
parentadb6bf82b0c780f9fbf36ef5bebaa38d4e7eb5ae (diff)
downloadCMake-0a83aa6f5700b424830136ebd2bf285e8ce6b56d.zip
CMake-0a83aa6f5700b424830136ebd2bf285e8ce6b56d.tar.gz
CMake-0a83aa6f5700b424830136ebd2bf285e8ce6b56d.tar.bz2
BUG: Fix windows command line escape for empty arg
On Windows the KWSys System package generates escapes for command-line arguments. This fix enables quoting of the empty string as an argument. This also adds a test to pass an empty argument to a custom command.
Diffstat (limited to 'Source/kwsys/System.c')
-rw-r--r--Source/kwsys/System.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/kwsys/System.c b/Source/kwsys/System.c
index d205c96..900b025 100644
--- a/Source/kwsys/System.c
+++ b/Source/kwsys/System.c
@@ -170,6 +170,12 @@ flag later when we understand applications of this better.
static int kwsysSystem_Shell__ArgumentNeedsQuotes(const char* in, int isUnix,
int flags)
{
+ /* The empty string needs quotes. */
+ if(!*in)
+ {
+ return 1;
+ }
+
/* Scan the string for characters that require quoting. */
{
const char* c;