[Pcre-svn] [376] code/trunk: Bug fixes: forgot to commit the…

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [376] code/trunk: Bug fixes: forgot to commit these individually.
Revision: 376
          http://vcs.pcre.org/viewvc?view=rev&revision=376
Author:   ph10
Date:     2009-03-01 12:00:59 +0000 (Sun, 01 Mar 2009)


Log Message:
-----------
Bug fixes: forgot to commit these individually.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/Makefile.am
    code/trunk/README
    code/trunk/configure.ac
    code/trunk/doc/pcreapi.3
    code/trunk/doc/pcregrep.1
    code/trunk/pcre_config.c
    code/trunk/pcre_internal.h
    code/trunk/pcretest.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2008-09-05 16:48:55 UTC (rev 375)
+++ code/trunk/ChangeLog    2009-03-01 12:00:59 UTC (rev 376)
@@ -1,6 +1,30 @@
 ChangeLog for PCRE
 ------------------


+Version 7.9 xx-xxx-09
+---------------------
+
+1.  When building with support for bzlib/zlib (pcregrep) and/or readline 
+    (pcretest), all targets were linked against these libraries. This included
+    libpcre, libpcreposix, and libpcrecpp, even though they do not use these
+    libraries. This caused unwanted dependencies to be created. This problem
+    has been fixed, and now only pcregrep is linked with bzlib/zlib and only 
+    pcretest is linked with readline.
+    
+2.  The "typedef int BOOL" in pcre_internal.h that was included inside the
+    "#ifndef FALSE" condition by an earlier change (probably 7.8/18) has been
+    moved outside it again, because FALSE and TRUE are already defined in AIX,
+    but BOOL is not.
+    
+3.  The pcre_config() function was treating the PCRE_MATCH_LIMIT and 
+    PCRE_MATCH_LIMIT_RETURSION values as ints, when they should be long ints.
+    
+4.  The pcregrep documentation said spaces were inserted as well as colons (or
+    hyphens) following file names and line numbers when outputting matching
+    lines. This is not true; no spaces are inserted. I have also clarified the 
+    wording for the --colour (or --color) option.
+      
+
 Version 7.8 05-Sep-08
 ---------------------



Modified: code/trunk/Makefile.am
===================================================================
--- code/trunk/Makefile.am    2008-09-05 16:48:55 UTC (rev 375)
+++ code/trunk/Makefile.am    2009-03-01 12:00:59 UTC (rev 376)
@@ -243,13 +243,13 @@
 EXTRA_DIST += RunTest.bat
 bin_PROGRAMS += pcretest
 pcretest_SOURCES = pcretest.c
-pcretest_LDADD = libpcreposix.la
+pcretest_LDADD = libpcreposix.la $(LIBREADLINE)


TESTS += RunGrepTest
dist_noinst_SCRIPTS += RunGrepTest
bin_PROGRAMS += pcregrep
pcregrep_SOURCES = pcregrep.c
-pcregrep_LDADD = libpcreposix.la
+pcregrep_LDADD = libpcreposix.la $(LIBZ) $(LIBBZ2)

EXTRA_DIST += \
testdata/grepinput \

Modified: code/trunk/README
===================================================================
--- code/trunk/README    2008-09-05 16:48:55 UTC (rev 375)
+++ code/trunk/README    2009-03-01 12:00:59 UTC (rev 376)
@@ -286,7 +286,9 @@
   to specify something like LIBS="-lncurses" as well. This is because, to quote
   the readline INSTALL, "Readline uses the termcap functions, but does not link
   with the termcap or curses library itself, allowing applications which link
-  with readline the to choose an appropriate library."
+  with readline the to choose an appropriate library." If you get error 
+  messages about missing functions tgetstr, tgetent, tputs, tgetflag, or tgoto, 
+  this is the problem, and linking with the ncurses library should fix it. 


The "configure" script builds the following files for the basic C library:

@@ -753,4 +755,4 @@
Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk
-Last updated: 05 September 2008
+Last updated: 27 February 2009

Modified: code/trunk/configure.ac
===================================================================
--- code/trunk/configure.ac    2008-09-05 16:48:55 UTC (rev 375)
+++ code/trunk/configure.ac    2009-03-01 12:00:59 UTC (rev 376)
@@ -7,9 +7,9 @@
 dnl empty.


m4_define(pcre_major, [7])
-m4_define(pcre_minor, [8])
-m4_define(pcre_prerelease, [])
-m4_define(pcre_date, [2008-09-05])
+m4_define(pcre_minor, [9])
+m4_define(pcre_prerelease, [-RC1])
+m4_define(pcre_date, [2009-02-27])

# Libtool shared library interface versions (current:revision:age)
m4_define(libpcre_version, [0:1:0])
@@ -539,7 +539,7 @@
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)

# Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is
-# specified, the relevant library is available. If so, add it to LIBS.
+# specified, the relevant library is available.

 if test "$enable_pcregrep_libz" = "yes"; then
   if test "$HAVE_ZLIB_H" != "1"; then
@@ -550,8 +550,9 @@
     echo "** Cannot --enable-pcregrep-libz because libz was not found"
     exit 1
   fi
-  if test "$LIBS" = ""; then LIBS=-lz; else LIBS="$LIBS -lz"; fi
+  LIBZ="-lz"
 fi
+AC_SUBST(LIBZ)


 if test "$enable_pcregrep_libbz2" = "yes"; then
   if test "$HAVE_BZLIB_H" != "1"; then
@@ -562,8 +563,9 @@
     echo "** Cannot --enable-pcregrep-libbz2 because libbz2 was not found"
     exit 1
   fi
-  if test "$LIBS" = ""; then LIBS=-lbz2; else LIBS="$LIBS -lbz2"; fi
+  LIBBZ2="-lbz2"
 fi
+AC_SUBST(LIBBZ2)


# Similarly for --enable-pcretest-readline

@@ -576,8 +578,9 @@
     echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."
     exit 1
   fi
-  if test "$LIBS" = ""; then LIBS=-lreadline; else LIBS="$LIBS -lreadline"; fi
+  LIBREADLINE="-lreadline"
 fi
+AC_SUBST(LIBREADLINE)


# Produce these files, in addition to config.h.
AC_CONFIG_FILES(

Modified: code/trunk/doc/pcreapi.3
===================================================================
--- code/trunk/doc/pcreapi.3    2008-09-05 16:48:55 UTC (rev 375)
+++ code/trunk/doc/pcreapi.3    2009-03-01 12:00:59 UTC (rev 376)
@@ -347,13 +347,13 @@
 .sp
   PCRE_CONFIG_MATCH_LIMIT
 .sp
-The output is an integer that gives the default limit for the number of
+The output is a long integer that gives the default limit for the number of
 internal matching function calls in a \fBpcre_exec()\fP execution. Further
 details are given with \fBpcre_exec()\fP below.
 .sp
   PCRE_CONFIG_MATCH_LIMIT_RECURSION
 .sp
-The output is an integer that gives the default limit for the depth of
+The output is a long integer that gives the default limit for the depth of
 recursion when calling the internal matching function in a \fBpcre_exec()\fP
 execution. Further details are given with \fBpcre_exec()\fP below.
 .sp
@@ -1978,6 +1978,6 @@
 .rs
 .sp
 .nf
-Last updated: 24 August 2008
-Copyright (c) 1997-2008 University of Cambridge.
+Last updated: 28 February 2009
+Copyright (c) 1997-2009 University of Cambridge.
 .fi


Modified: code/trunk/doc/pcregrep.1
===================================================================
--- code/trunk/doc/pcregrep.1    2008-09-05 16:48:55 UTC (rev 375)
+++ code/trunk/doc/pcregrep.1    2009-03-01 12:00:59 UTC (rev 376)
@@ -115,16 +115,16 @@
 equals sign.
 .TP
 \fB--colour=\fP\fIvalue\fP, \fB--color=\fP\fIvalue\fP
-This option specifies under what circumstances the part of a line that matched
-a pattern should be coloured in the output. The value may be "never" (the
-default), "always", or "auto". In the latter case, colouring happens only if
-the standard output is connected to a terminal. The colour can be specified by
-setting the environment variable PCREGREP_COLOUR or PCREGREP_COLOR. The value
-of this variable should be a string of two numbers, separated by a semicolon.
-They are copied directly into the control string for setting colour on a
-terminal, so it is your responsibility to ensure that they make sense. If
-neither of the environment variables is set, the default is "1;31", which gives
-red.
+This option specifies under what circumstances the parts of a line that matched
+a pattern should be coloured in the output. By default, the output is not
+coloured. The value (which is optional, see above) may be "never", "always", or
+"auto". In the latter case, colouring happens only if the standard output is
+connected to a terminal. The colour that is used can be specified by setting
+the environment variable PCREGREP_COLOUR or PCREGREP_COLOR. The value of this
+variable should be a string of two numbers, separated by a semicolon. They are
+copied directly into the control string for setting colour on a terminal, so it
+is your responsibility to ensure that they make sense. If neither of the
+environment variables is set, the default is "1;31", which gives red.
 .TP
 \fB-D\fP \fIaction\fP, \fB--devices=\fP\fIaction\fP
 If an input path is not a regular file or a directory, "action" specifies how
@@ -204,16 +204,15 @@
 \fB-H\fP, \fB--with-filename\fP
 Force the inclusion of the filename at the start of output lines when searching
 a single file. By default, the filename is not shown in this case. For matching
-lines, the filename is followed by a colon and a space; for context lines, a
-hyphen separator is used. If a line number is also being output, it follows the
-file name without a space.
+lines, the filename is followed by a colon; for context lines, a hyphen
+separator is used. If a line number is also being output, it follows the file
+name.
 .TP
 \fB-h\fP, \fB--no-filename\fP
 Suppress the output filenames when searching multiple files. By default,
 filenames are shown when multiple files are searched. For matching lines, the
-filename is followed by a colon and a space; for context lines, a hyphen
-separator is used. If a line number is also being output, it follows the file
-name without a space.
+filename is followed by a colon; for context lines, a hyphen separator is used.
+If a line number is also being output, it follows the file name.
 .TP
 \fB--help\fP
 Output a help message, giving brief details of the command options and file
@@ -305,9 +304,9 @@
 .TP
 \fB-n\fP, \fB--line-number\fP
 Precede each output line by its line number in the file, followed by a colon
-and a space for matching lines or a hyphen and a space for context lines. If
-the filename is also being output, it precedes the line number. This option is
-forced if \fB--line-offsets\fP is used.
+for matching lines or a hyphen for context lines. If the filename is also being
+output, it precedes the line number. This option is forced if
+\fB--line-offsets\fP is used.
 .TP
 \fB-o\fP, \fB--only-matching\fP
 Show only the part of the line that matched a pattern. In this mode, no
@@ -458,6 +457,6 @@
 .rs
 .sp
 .nf
-Last updated: 08 March 2008
-Copyright (c) 1997-2008 University of Cambridge.
+Last updated: 01 March 2009
+Copyright (c) 1997-2009 University of Cambridge.
 .fi


Modified: code/trunk/pcre_config.c
===================================================================
--- code/trunk/pcre_config.c    2008-09-05 16:48:55 UTC (rev 375)
+++ code/trunk/pcre_config.c    2009-03-01 12:00:59 UTC (rev 376)
@@ -6,7 +6,7 @@
 and semantics are as close as possible to those of the Perl 5 language.


                        Written by Philip Hazel
-           Copyright (c) 1997-2008 University of Cambridge
+           Copyright (c) 1997-2009 University of Cambridge


-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -104,11 +104,11 @@
break;

case PCRE_CONFIG_MATCH_LIMIT:
- *((unsigned int *)where) = MATCH_LIMIT;
+ *((unsigned long int *)where) = MATCH_LIMIT;
break;

case PCRE_CONFIG_MATCH_LIMIT_RECURSION:
- *((unsigned int *)where) = MATCH_LIMIT_RECURSION;
+ *((unsigned long int *)where) = MATCH_LIMIT_RECURSION;
break;

case PCRE_CONFIG_STACKRECURSE:

Modified: code/trunk/pcre_internal.h
===================================================================
--- code/trunk/pcre_internal.h    2008-09-05 16:48:55 UTC (rev 375)
+++ code/trunk/pcre_internal.h    2009-03-01 12:00:59 UTC (rev 376)
@@ -7,7 +7,7 @@
 and semantics are as close as possible to those of the Perl 5 language.


                        Written by Philip Hazel
-           Copyright (c) 1997-2008 University of Cambridge
+           Copyright (c) 1997-2009 University of Cambridge


 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -560,11 +560,12 @@
 #define REQ_VARY     0x0200    /* reqbyte followed non-literal item */


/* Miscellaneous definitions. The #ifndef is to pacify compiler warnings in
-environments where these macros are defined elsewhere. */
+environments where these macros are defined elsewhere. Unfortunately, there
+is no way to do the same for the typedef. */

-#ifndef FALSE
typedef int BOOL;

+#ifndef FALSE
 #define FALSE   0
 #define TRUE    1
 #endif


Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2008-09-05 16:48:55 UTC (rev 375)
+++ code/trunk/pcretest.c    2009-03-01 12:00:59 UTC (rev 376)
@@ -925,6 +925,7 @@
   else if (strcmp(argv[op], "-C") == 0)
     {
     int rc;
+    unsigned long int lrc; 
     printf("PCRE version %s\n", pcre_version());
     printf("Compiled with\n");
     (void)pcre_config(PCRE_CONFIG_UTF8, &rc);
@@ -943,10 +944,10 @@
     printf("  Internal link size = %d\n", rc);
     (void)pcre_config(PCRE_CONFIG_POSIX_MALLOC_THRESHOLD, &rc);
     printf("  POSIX malloc threshold = %d\n", rc);
-    (void)pcre_config(PCRE_CONFIG_MATCH_LIMIT, &rc);
-    printf("  Default match limit = %d\n", rc);
-    (void)pcre_config(PCRE_CONFIG_MATCH_LIMIT_RECURSION, &rc);
-    printf("  Default recursion depth limit = %d\n", rc);
+    (void)pcre_config(PCRE_CONFIG_MATCH_LIMIT, &lrc);
+    printf("  Default match limit = %ld\n", lrc);
+    (void)pcre_config(PCRE_CONFIG_MATCH_LIMIT_RECURSION, &lrc);
+    printf("  Default recursion depth limit = %ld\n", lrc);
     (void)pcre_config(PCRE_CONFIG_STACKRECURSE, &rc);
     printf("  Match recursion uses %s\n", rc? "stack" : "heap");
     goto EXIT;