[Pcre-svn] [1567] code/trunk: Fix \a and \e in pcretest, an…

トップ ページ
このメッセージを削除
著者: Subversion repository
日付:  
To: pcre-svn
題目: [Pcre-svn] [1567] code/trunk: Fix \a and \e in pcretest, and \a in pcre_compile, on EBCDIC platforms.
Revision: 1567
          http://vcs.pcre.org/viewvc?view=rev&revision=1567
Author:   ph10
Date:     2015-06-12 17:24:58 +0100 (Fri, 12 Jun 2015)
Log Message:
-----------
Fix \a and \e in pcretest, and \a in pcre_compile, on EBCDIC platforms.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_compile.c
    code/trunk/pcre_internal.h
    code/trunk/pcretest.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2015-06-09 17:45:25 UTC (rev 1566)
+++ code/trunk/ChangeLog    2015-06-12 16:24:58 UTC (rev 1567)
@@ -51,6 +51,12 @@
 11. If a non-capturing group containing a conditional group that could match
     an empty string was repeated, it was not identified as matching an empty
     string itself. For example: /^(?:(?(1)x|)+)+$()/.
+    
+12. In an EBCDIC environment, pcretest was mishandling the escape sequences
+    \a and \e in test subject lines. 
+    
+13. In an EBCDIC environment, \a in a pattern was converted to the ASCII 
+    instead of the EBCDIC value. 



Version 8.37 28-April-2015

Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2015-06-09 17:45:25 UTC (rev 1566)
+++ code/trunk/pcre_compile.c    2015-06-12 16:24:58 UTC (rev 1567)
@@ -174,7 +174,7 @@
      -ESC_Z,                  CHAR_LEFT_SQUARE_BRACKET,
      CHAR_BACKSLASH,          CHAR_RIGHT_SQUARE_BRACKET,
      CHAR_CIRCUMFLEX_ACCENT,  CHAR_UNDERSCORE,
-     CHAR_GRAVE_ACCENT,       7,
+     CHAR_GRAVE_ACCENT,       ESC_a,
      -ESC_b,                  0,
      -ESC_d,                  ESC_e,
      ESC_f,                   0,
@@ -202,7 +202,7 @@
 /*  68 */     0,     0,    '|',     ',',    '%',   '_',    '>',    '?',
 /*  70 */     0,     0,      0,       0,      0,     0,      0,      0,
 /*  78 */     0,   '`',    ':',     '#',    '@',  '\'',    '=',    '"',
-/*  80 */     0,     7, -ESC_b,       0, -ESC_d, ESC_e,  ESC_f,      0,
+/*  80 */     0, ESC_a, -ESC_b,       0, -ESC_d, ESC_e,  ESC_f,      0,
 /*  88 */-ESC_h,     0,      0,     '{',      0,     0,      0,      0,
 /*  90 */     0,     0, -ESC_k,       0,      0, ESC_n,      0, -ESC_p,
 /*  98 */     0, ESC_r,      0,     '}',      0,     0,      0,      0,


Modified: code/trunk/pcre_internal.h
===================================================================
--- code/trunk/pcre_internal.h    2015-06-09 17:45:25 UTC (rev 1566)
+++ code/trunk/pcre_internal.h    2015-06-12 16:24:58 UTC (rev 1567)
@@ -1762,6 +1762,10 @@


/* Escape items that are just an encoding of a particular data value. */

+#ifndef ESC_a
+#define ESC_a CHAR_BEL
+#endif
+
#ifndef ESC_e
#define ESC_e CHAR_ESC
#endif

Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2015-06-09 17:45:25 UTC (rev 1566)
+++ code/trunk/pcretest.c    2015-06-12 16:24:58 UTC (rev 1567)
@@ -4621,9 +4621,9 @@


       else switch ((c = *p++))
         {
-        case 'a': c =    7; break;
+        case 'a': c =  CHAR_BEL; break;
         case 'b': c = '\b'; break;
-        case 'e': c =   27; break;
+        case 'e': c =  CHAR_ESC; break;
         case 'f': c = '\f'; break;
         case 'n': c = '\n'; break;
         case 'r': c = '\r'; break;