diff --git a/Makefile.in b/Makefile.in index ad66afd3..34ae6569 100644 --- a/Makefile.in +++ b/Makefile.in @@ -131,6 +131,7 @@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ SQLITE3_VERSION = @SQLITE3_VERSION@ +STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ diff --git a/NEWS b/NEWS index f7443cac..2cf3e9ca 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,7 @@ +lnav v0.4.0: + + lnav v0.3.0: Changes: * The hotkey for the SQL view was changed to 'v' and 'V' from '.'. diff --git a/configure b/configure index d5938000..5ed79f5b 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for lnav 0.3.0. +# Generated by GNU Autoconf 2.63 for lnav 0.4.0. # # Report bugs to . # @@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='lnav' PACKAGE_TARNAME='lnav' -PACKAGE_VERSION='0.3.0' -PACKAGE_STRING='lnav 0.3.0' +PACKAGE_VERSION='0.4.0' +PACKAGE_STRING='lnav 0.4.0' PACKAGE_BUGREPORT='timothyshanestack@gmail.com' ac_unique_file="src/lnav.cc" @@ -667,6 +667,7 @@ CC LN_S RANLIB CFLAGS_PG +STATIC_LDFLAGS am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE @@ -756,6 +757,7 @@ ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking +enable_static enable_profiling with_ncurses with_pcre @@ -1326,7 +1328,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures lnav 0.3.0 to adapt to many kinds of systems. +\`configure' configures lnav 0.4.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1396,7 +1398,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of lnav 0.3.0:";; + short | recursive ) echo "Configuration of lnav 0.4.0:";; esac cat <<\_ACEOF @@ -1406,6 +1408,7 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors + --disable-static Disable static linking --enable-profiling Compile with gprof(1) profiling support Optional Packages: @@ -1495,7 +1498,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -lnav configure 0.3.0 +lnav configure 0.4.0 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1509,7 +1512,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by lnav $as_me 0.3.0, which was +It was created by lnav $as_me 0.4.0, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -2226,7 +2229,7 @@ fi # Define the identity of the package. PACKAGE=lnav - VERSION=0.3.0 + VERSION=0.4.0 cat >>confdefs.h <<_ACEOF @@ -3264,6 +3267,16 @@ fi #CFLAGS=`echo $CFLAGS | sed 's/-O2//g'` #CXXFLAGS=`echo $CXXFLAGS | sed 's/-O2//g'` +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; +fi + +if test x"${enable_static}" != x"no"; then + STATIC_LDFLAGS="$STATIC_LDFLAGS -static" +fi + + # Check whether --enable-profiling was given. if test "${enable_profiling+set}" = set; then enableval=$enable_profiling; @@ -7568,7 +7581,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by lnav $as_me 0.3.0, which was +This file was extended by lnav $as_me 0.4.0, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7631,7 +7644,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -lnav config.status 0.3.0 +lnav config.status 0.4.0 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.in b/configure.in index 9d48d443..f014e166 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ -AC_INIT(lnav, 0.3.0, timothyshanestack@gmail.com) +AC_INIT(lnav, 0.4.0, timothyshanestack@gmail.com) AC_CONFIG_SRCDIR([src/lnav.cc]) -AM_INIT_AUTOMAKE(lnav, 0.3.0) +AM_INIT_AUTOMAKE(lnav, 0.4.0) AC_PREFIX_DEFAULT(/usr/) @@ -27,6 +27,14 @@ AC_PROG_CXX #CFLAGS=`echo $CFLAGS | sed 's/-O2//g'` #CXXFLAGS=`echo $CXXFLAGS | sed 's/-O2//g'` +AC_ARG_ENABLE([static], + AS_HELP_STRING([--disable-static], + [Disable static linking])) +if test x"${enable_static}" != x"no"; then + STATIC_LDFLAGS="$STATIC_LDFLAGS -static" +fi +AC_SUBST(STATIC_LDFLAGS) + AC_ARG_ENABLE([profiling], AS_HELP_STRING([--enable-profiling], [Compile with gprof(1) profiling support])) diff --git a/src/Makefile.am b/src/Makefile.am index 7faf6b69..df4ca793 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,7 +26,7 @@ AM_LDFLAGS = \ $(SQLITE3_LDFLAGS) \ $(PCRE_LDFLAGS) \ -pthread \ - -static + $(STATIC_LDFLAGS) AM_CPPFLAGS = \ -Wall \ diff --git a/src/Makefile.in b/src/Makefile.in index 2c9c67de..f1fd48a7 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -145,6 +145,7 @@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ SQLITE3_VERSION = @SQLITE3_VERSION@ +STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ @@ -208,7 +209,7 @@ AM_LDFLAGS = \ $(SQLITE3_LDFLAGS) \ $(PCRE_LDFLAGS) \ -pthread \ - -static + $(STATIC_LDFLAGS) AM_CPPFLAGS = \ -Wall \ diff --git a/src/pcrepp.hh b/src/pcrepp.hh index db3c4c54..87811b43 100644 --- a/src/pcrepp.hh +++ b/src/pcrepp.hh @@ -176,15 +176,18 @@ public: (int *)pc.all(), count * 2); + if (rc < 0) { } else if (rc == 0) { rc = 0; } - else if (pc.all()->c_begin == pc.all()->c_end) + else if (pc.all()->c_begin == pc.all()->c_end) { rc = 0; - else + } + else { pi.pi_next_offset = pc.all()->c_end; + } pc.set_count(rc); diff --git a/test/Makefile.in b/test/Makefile.in index f09bcac1..b98ec3e1 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -210,6 +210,7 @@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ SQLITE3_VERSION = @SQLITE3_VERSION@ +STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ diff --git a/test/test_pcrepp.cc b/test/test_pcrepp.cc index 987de22d..21e1dd94 100644 --- a/test/test_pcrepp.cc +++ b/test/test_pcrepp.cc @@ -23,12 +23,18 @@ int main(int argc, char *argv[]) { pcrepp match1("(\\w*)=(\\d+)"); pcre_input pi("a=1 b=2"); - + pcre_context::capture_t *cap; + assert(match1.match(context, pi)); + + cap = context.all(); + assert(cap->c_begin == 0); + assert(cap->c_end == 3); + assert((context.end() - context.begin()) == 2); assert(pi.get_substr(context.begin()) == "a"); assert(pi.get_substr(context.begin() + 1) == "1"); - + assert(match1.match(context, pi)); assert((context.end() - context.begin()) == 2); assert(pi.get_substr(context.begin()) == "b");