[cmake-commits] king committed System.c 1.8 1.9

cmake-commits at cmake.org cmake-commits at cmake.org
Thu May 17 14:01:05 EDT 2007


Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv29493

Modified Files:
	System.c 
Log Message:
BUG: Some single-character arguments need quoting on windows.


Index: System.c
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/System.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- System.c	17 May 2007 14:53:14 -0000	1.8
+++ System.c	17 May 2007 18:01:02 -0000	1.9
@@ -50,6 +50,15 @@
 
 */
 
+/*
+TODO: For windows echo:
+
+To display a pipe (|) or redirection character (< or >) when using the
+echo command, use a caret character immediately before the pipe or
+redirection character (for example, ^>, ^<, or ^| ). If you need to
+use the caret character itself (^), use two in a row (^^).
+*/
+
 /*--------------------------------------------------------------------------*/
 static int kwsysSystem_Shell__CharIsWhitespace(char c)
 {
@@ -159,6 +168,7 @@
                                                   int flags)
 {
   /* Scan the string for characters that require quoting.  */
+  {
   const char* c;
   for(c=in; *c; ++c)
     {
@@ -191,6 +201,18 @@
       return 1;
       }
     }
+  }
+
+  /* On Windows some single character arguments need quotes.  */
+  if(!isUnix && *in && !*(in+1))
+    {
+    char c = *in;
+    if((c == '?') || (c == '&') || (c == '^') || (c == '|') || (c == '#'))
+      {
+      return 1;
+      }
+    }
+
   return 0;
 }
 



More information about the Cmake-commits mailing list