[Pcre-svn] [481] code/trunk: Forbid 08 and 09 as minor versi…

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [481] code/trunk: Forbid 08 and 09 as minor version numbers.
Revision: 481
          http://vcs.pcre.org/viewvc?view=rev&revision=481
Author:   ph10
Date:     2010-01-03 17:45:53 +0000 (Sun, 03 Jan 2010)


Log Message:
-----------
Forbid 08 and 09 as minor version numbers.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/configure.ac


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2010-01-03 17:29:59 UTC (rev 480)
+++ code/trunk/ChangeLog    2010-01-03 17:45:53 UTC (rev 481)
@@ -81,6 +81,13 @@
     most of the time, it *can* run out if it is given a pattern that contains a 
     runaway infinite recursion. I updated the discussion in the pcrestack man 
     page.  
+    
+13. Now that we have gone to the x.xx style of version numbers, the minor 
+    version may start with zero. Using 08 or 09 is a bad idea because users 
+    might check the value of PCRE_MINOR in their code, and 08 or 09 may be 
+    interpreted as invalid octal numbers. I've updated the previous comment in 
+    configure.ac, and also added a check that gives an error if 08 or 09 are 
+    used.





Modified: code/trunk/configure.ac
===================================================================
--- code/trunk/configure.ac    2010-01-03 17:29:59 UTC (rev 480)
+++ code/trunk/configure.ac    2010-01-03 17:45:53 UTC (rev 481)
@@ -1,11 +1,13 @@
 dnl Process this file with autoconf to produce a configure script.


-dnl NOTE FOR MAINTAINERS: Do not use major or minor version numbers with
-dnl leading zeros, because they may be treated as octal constants. The
-dnl PCRE_PRERELEASE feature is for identifying release candidates. It might
-dnl be defined as -RC2, for example. For real releases, it should be defined
-dnl empty.
+dnl NOTE FOR MAINTAINERS: Do not use minor version numbers 08 or 09 because
+dnl the leading zeros may cause them to be treated as invalid octal constants
+dnl if a PCRE user writes code that uses PCRE_MINOR as a number. There is now
+dnl a check further down that throws an error if 08 or 09 are used.

+dnl The PCRE_PRERELEASE feature is for identifying release candidates. It might
+dnl be defined as -RC2, for example. For real releases, it should be empty.
+
m4_define(pcre_major, [8])
m4_define(pcre_minor, [01])
m4_define(pcre_prerelease, [-RC1])
@@ -82,6 +84,15 @@
PCRE_PRERELEASE="pcre_prerelease"
PCRE_DATE="pcre_date"

+if test "$PCRE_MINOR" = "08" -o "$PCRE_MINOR" = "09"
+then
+  echo "***"
+  echo "*** Minor version number $PCRE_MINOR must not be used. ***"
+  echo "*** Use only 01 to 07 or 10 onwards, to avoid octal issues. ***" 
+  echo "***" 
+  exit 1
+fi    
+
 AC_SUBST(PCRE_MAJOR)
 AC_SUBST(PCRE_MINOR)
 AC_SUBST(PCRE_PRERELEASE)