[Cmake-commits] [cmake-commits] king committed cmFileCommand.cxx 1.138 1.139

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Oct 6 16:33:17 EDT 2009


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

Modified Files:
	cmFileCommand.cxx 
Log Message:
Support more special characters in file(STRINGS)

The commits "Teach Fortran compiler identification about the Portland
Group compiler" and "Fix previous change to file(STRINGS) command"
taught file(STRINGS) to recognize the form-feed '\f' character as part
of string literals.  The Portland Group Fortran compiler also puts 0x14
bytes at the end of string literals in some cases.  We generalize the
previous solution and add the new character in this commit.


Index: cmFileCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.cxx,v
retrieving revision 1.138
retrieving revision 1.139
diff -C 2 -d -r1.138 -r1.139
*** cmFileCommand.cxx	30 Sep 2009 15:41:34 -0000	1.138
--- cmFileCommand.cxx	6 Oct 2009 20:33:15 -0000	1.139
***************
*** 532,535 ****
--- 532,542 ----
      }
  
+   // At least one compiler (Portland Group Fortran) produces binaries
+   // with some extra characters in strings.
+   char extra[256]; // = {}; // some compilers do not like this
+   memset(extra, 0, sizeof(extra));
+   extra['\f'] = 1; // FF  (form feed)
+   extra[0x14] = 1; // DC4 (device control 4)
+ 
    // Parse strings out of the file.
    int output_size = 0;
***************
*** 586,590 ****
        // Ignore CR character to make output always have UNIX newlines.
        }
!     else if((c >= 0x20 && c < 0x7F) || c == '\t' || c == '\f' ||
              (c == '\n' && newline_consume))
        {
--- 593,597 ----
        // Ignore CR character to make output always have UNIX newlines.
        }
!     else if((c >= 0x20 && c < 0x7F) || c == '\t' || extra[c] ||
              (c == '\n' && newline_consume))
        {



More information about the Cmake-commits mailing list