[Pcre-svn] [638] code/trunk: Minor code tidy.

トップ ページ
このメッセージを削除
著者: Subversion repository
日付:  
To: pcre-svn
題目: [Pcre-svn] [638] code/trunk: Minor code tidy.
Revision: 638
          http://vcs.pcre.org/viewvc?view=rev&revision=638
Author:   ph10
Date:     2011-07-25 10:41:19 +0100 (Mon, 25 Jul 2011)


Log Message:
-----------
Minor code tidy.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_compile.c
    code/trunk/testdata/testinput5
    code/trunk/testdata/testoutput5


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2011-07-24 17:44:12 UTC (rev 637)
+++ code/trunk/ChangeLog    2011-07-25 09:41:19 UTC (rev 638)
@@ -177,6 +177,8 @@
     does, and because of capturing effects, quantifying parenthesized 
     assertions may at times be useful. Quantifiers are now allowed for 
     parenthesized assertions.
+    
+34. A minor code tidy in pcre_compile() when checking options for \R usage. 



Version 8.12 15-Jan-2011

Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2011-07-24 17:44:12 UTC (rev 637)
+++ code/trunk/pcre_compile.c    2011-07-25 09:41:19 UTC (rev 638)
@@ -7084,13 +7084,11 @@


/* Check validity of \R options. */

-switch (options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE))
+if ((options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) ==
+     (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE))
   {
-  case 0:
-  case PCRE_BSR_ANYCRLF:
-  case PCRE_BSR_UNICODE:
-  break;
-  default: errorcode = ERR56; goto PCRE_EARLY_ERROR_RETURN;
+  errorcode = ERR56; 
+  goto PCRE_EARLY_ERROR_RETURN;
   }


/* Handle different types of newline. The three bits give seven cases. The

Modified: code/trunk/testdata/testinput5
===================================================================
--- code/trunk/testdata/testinput5    2011-07-24 17:44:12 UTC (rev 637)
+++ code/trunk/testdata/testinput5    2011-07-25 09:41:19 UTC (rev 638)
@@ -879,4 +879,6 @@
 /^\X/8 
     ́réo


+//<bsr_anycrlf><bsr_unicode>
+
/-- End of testinput5 --/

Modified: code/trunk/testdata/testoutput5
===================================================================
--- code/trunk/testdata/testoutput5    2011-07-24 17:44:12 UTC (rev 637)
+++ code/trunk/testdata/testoutput5    2011-07-25 09:41:19 UTC (rev 638)
@@ -2429,4 +2429,7 @@
     ́réo
 No match


+//<bsr_anycrlf><bsr_unicode>
+Failed: inconsistent NEWLINE options at offset 0
+
/-- End of testinput5 --/