[Pcre-svn] [734] code/trunk: Fix ASCII dependency in pcretes…

トップ ページ
このメッセージを削除
著者: Subversion repository
日付:  
To: pcre-svn
題目: [Pcre-svn] [734] code/trunk: Fix ASCII dependency in pcretest when decoding hex characters.
Revision: 734
          http://vcs.pcre.org/viewvc?view=rev&revision=734
Author:   ph10
Date:     2011-10-12 17:35:29 +0100 (Wed, 12 Oct 2011)


Log Message:
-----------
Fix ASCII dependency in pcretest when decoding hex characters.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcretest.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2011-10-11 10:29:36 UTC (rev 733)
+++ code/trunk/ChangeLog    2011-10-12 16:35:29 UTC (rev 734)
@@ -103,6 +103,10 @@
 19. If the PCRE_NO_START_OPTIMIZE option was set for pcre_compile(), it did not
     suppress the check for a minimum subject length at run time. (If it was
     given to pcre_exec() or pcre_dfa_exec() it did work.)
+    
+20. Fixed an ASCII-dependent infelicity in pcretest that would have made it
+    fail to work when decoding hex characters in data strings in EBCDIC 
+    environments. 



Version 8.13 16-Aug-2011

Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2011-10-11 10:29:36 UTC (rev 733)
+++ code/trunk/pcretest.c    2011-10-12 16:35:29 UTC (rev 734)
@@ -2347,7 +2347,7 @@
           unsigned char *pt = p;
           c = 0;
           while (isxdigit(*(++pt)))
-            c = c * 16 + tolower(*pt) - ((isdigit(*pt))? '0' : 'W');
+            c = c * 16 + tolower(*pt) - ((isdigit(*pt))? '0' : 'a' - 10);
           if (*pt == '}')
             {
             unsigned char buff8[8];
@@ -2377,7 +2377,7 @@
         c = 0;
         while (i++ < 2 && isxdigit(*p))
           {
-          c = c * 16 + tolower(*p) - ((isdigit(*p))? '0' : 'W');
+          c = c * 16 + tolower(*p) - ((isdigit(*p))? '0' : 'a' - 10);
           p++;
           }
         break;