[Pcre-svn] [1097] code/trunk: pcre32: pcretest: Add explicit…

Startseite
Nachricht löschen
Autor: Subversion repository
Datum:  
To: pcre-svn
Betreff: [Pcre-svn] [1097] code/trunk: pcre32: pcretest: Add explicit -8 option
Revision: 1097
          http://vcs.pcre.org/viewvc?view=rev&revision=1097
Author:   chpe
Date:     2012-10-16 16:56:13 +0100 (Tue, 16 Oct 2012)


Log Message:
-----------
pcre32: pcretest: Add explicit -8 option

Even though 8-bit mode is the default, it's still useful to have an -8
option for symmetry.

Modified Paths:
--------------
    code/trunk/doc/pcretest.1
    code/trunk/pcretest.c


Modified: code/trunk/doc/pcretest.1
===================================================================
--- code/trunk/doc/pcretest.1    2012-10-16 15:56:09 UTC (rev 1096)
+++ code/trunk/doc/pcretest.1    2012-10-16 15:56:13 UTC (rev 1097)
@@ -62,6 +62,11 @@
 .SH "COMMAND LINE OPTIONS"
 .rs
 .TP 10
+\fB-8\fP
+If both the 8-bit library has been built, this option causes the 8-bit library
+to be used (which is the default); if the 8-bit library has not been built,
+this option causes an error.
+.TP 10
 \fB-16\fP
 If both the 8-bit or the 32-bit, and the 16-bit libraries have been built, this
 option causes the 16-bit library to be used. If only the 16-bit library has been


Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2012-10-16 15:56:09 UTC (rev 1096)
+++ code/trunk/pcretest.c    2012-10-16 15:56:13 UTC (rev 1097)
@@ -2807,6 +2807,15 @@
       force_study_options = jit_study_bits[*arg - '1'];
     else goto BAD_ARG;
     }
+  else if (strcmp(arg, "-8") == 0)
+    {
+#ifdef SUPPORT_PCRE8
+    pcre_mode = PCRE8_MODE;
+#else
+    printf("** This version of PCRE was built without 8-bit support\n");
+    exit(1);
+#endif
+    }
   else if (strcmp(arg, "-16") == 0)
     {
 #ifdef SUPPORT_PCRE16