Browse Source

do not escape spaces in regular expressions

The space has no special meaning in regular expressions so it doesn't need to
be escaped.
Rolf Eike Beer 13 years ago
parent
commit
637207e62a
3 changed files with 3 additions and 3 deletions
  1. 1 1
      Docs/bash-completion/cpack
  2. 1 1
      Modules/CPackRPM.cmake
  3. 1 1
      Modules/FindArmadillo.cmake

+ 1 - 1
Docs/bash-completion/cpack

@@ -8,7 +8,7 @@ _cpack()
     case "$prev" in
         -G)
             COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null |
-                grep "^  .*=\ .*" 2> /dev/null | grep -v "^  -" 2>/dev/null |
+                grep "^  .*= .*" 2> /dev/null | grep -v "^  -" 2>/dev/null |
                 cut -d" " -f 3 )' -- "$cur" ) )
             return
             ;;

+ 1 - 1
Modules/CPackRPM.cmake

@@ -259,7 +259,7 @@ if(RPMBUILD_EXECUTABLE)
                   OUTPUT_VARIABLE _TMP_VERSION
                   ERROR_QUIET
                   OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REGEX REPLACE "^.*\ " ""
+  string(REGEX REPLACE "^.* " ""
          RPMBUILD_EXECUTABLE_VERSION
          ${_TMP_VERSION})
   if(CPACK_RPM_PACKAGE_DEBUG)

+ 1 - 1
Modules/FindArmadillo.cmake

@@ -64,7 +64,7 @@ if(ARMADILLO_INCLUDE_DIR)
     string(REGEX REPLACE ".*#define ARMA_VERSION_PATCH ([0-9]+).*" "\\1" ARMADILLO_VERSION_PATCH "${_armadillo_HEADER_CONTENTS}")
 
     # WARNING: The number of spaces before the version name is not one.
-    string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")
+    string(REGEX REPLACE ".*#define ARMA_VERSION_NAME +\"([0-9a-zA-Z _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")
 
   endif()