*** C:\projects\pcre-8.37\pcre_compile.c	2015-05-14 20:20:12.000000000 -0400
--- C:\projects\pcreport\TESTING\compile8_for_patch.c	2015-06-12 09:19:24.000000000 -0400
***************
*** 1420,1434 ****
--- 1423,1479 ----
        {
        *errorcodeptr = ERR68;
        break;
        }
      if (c >= CHAR_a && c <= CHAR_z) c -= 32;
      c ^= 0x40;
+ #else
+ #ifdef NATIVE_ZOS    /* z/OS port */
      /* ZA: in correcting the \c behaviour, I left the existing,
         EBCDIC only code as is (see the last else below) because
         of concerns that someone, somewhere may be using that
         behviour.  However I added an option that would confine
         the change to the z/OS port users only, while allowing
         other EBCDIC users to use the old, wrong behaviour. */
+     {
+         char ebcdic_escape_c[33] =
+             "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_";
+         int ebcdic_control_character;
+         int ebcdic_valid = -1;
+         if (c >= CHAR_a && c <= CHAR_z) c += 64;
+         if (c == CHAR_QUESTION_MARK)
+         {
+             c = 0xff;
          /* This is correct in most cases; the exception
             is POSIX-BC*/
+             ebcdic_valid = 0;
+         }
+         else
+         {
+             for (ebcdic_control_character = 0;
+                  ebcdic_control_character < 32;
+                  ebcdic_control_character++)
+             {
+                 if (c ==
+                     ebcdic_escape_c[ebcdic_control_character])
+                 {
+                     c = (char) ebcdic_control_character;
+                     ebcdic_valid = 0;
+                     break;
+                 }
+             }
+         }
+         if (ebcdic_valid != 0) *errorcodeptr = ERR68;
          /* I use ERR68 despite being inaccurate here, so not to add an
             error message */
+     }
      /* existing EBCDIC code */
  #else             /* EBCDIC coding */
      if (c >= CHAR_a && c <= CHAR_z) c += 64;
      c ^= 0xC0;
+ #endif
  #endif
      break;
  
      /* PCRE_EXTRA enables extensions to Perl in the matter of escapes. Any
      other alphanumeric following \ is an error if PCRE_EXTRA was set;
      otherwise, for Perl compatibility, it is a literal. This code looks a bit
