Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ugrep for openSUSE:Factory checked in at 2026-05-04 12:54:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ugrep (Old) and /work/SRC/openSUSE:Factory/.ugrep.new.30200 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ugrep" Mon May 4 12:54:06 2026 rev:91 rq:1350528 version:7.8.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ugrep/ugrep.changes 2026-04-30 20:33:42.206927973 +0200 +++ /work/SRC/openSUSE:Factory/.ugrep.new.30200/ugrep.changes 2026-05-04 12:57:27.587215754 +0200 @@ -1,0 +2,7 @@ +Sun May 3 14:53:05 UTC 2026 - Andreas Stieger <[email protected]> + +- Update to version 7.8.1: + * fix --disable-avx512 + * fix handling very long lines in very large files + +------------------------------------------------------------------- Old: ---- ugrep-7.8.0.obscpio New: ---- ugrep-7.8.1.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ugrep.spec ++++++ --- /var/tmp/diff_new_pack.Iz0p7T/_old 2026-05-04 12:57:28.271243905 +0200 +++ /var/tmp/diff_new_pack.Iz0p7T/_new 2026-05-04 12:57:28.279244235 +0200 @@ -23,7 +23,7 @@ %bcond_without fish %endif Name: ugrep -Version: 7.8.0 +Version: 7.8.1 Release: 0 Summary: Universal grep: a feature-rich grep implementation with focus on speed License: BSD-3-Clause ++++++ _service ++++++ --- /var/tmp/diff_new_pack.Iz0p7T/_old 2026-05-04 12:57:28.375248186 +0200 +++ /var/tmp/diff_new_pack.Iz0p7T/_new 2026-05-04 12:57:28.407249502 +0200 @@ -5,7 +5,7 @@ <param name="changesgenerate">enable</param> <param name="filename">ugrep</param> <param name="versionformat">@PARENT_TAG@</param> - <param name="revision">v7.8.0</param> + <param name="revision">v7.8.1</param> <param name="versionrewrite-pattern">v(.*)</param> <param name="versionrewrite-replacement">\1</param> </service> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.Iz0p7T/_old 2026-05-04 12:57:28.467251972 +0200 +++ /var/tmp/diff_new_pack.Iz0p7T/_new 2026-05-04 12:57:28.471252136 +0200 @@ -1,7 +1,7 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/Genivia/ugrep.git</param> - <param name="changesrevision">5f6f5bd4f77df74faf01076f7d2407a603464868</param> + <param name="changesrevision">0ecc0aa45ad7b327a857cd90d5ec77501edae4b6</param> </service> </servicedata> (No newline at EOF) ++++++ ugrep-7.8.0.obscpio -> ugrep-7.8.1.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/Makefile.am new/ugrep-7.8.1/Makefile.am --- old/ugrep-7.8.0/Makefile.am 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/Makefile.am 2026-05-03 14:44:56.000000000 +0200 @@ -94,7 +94,7 @@ echo "| pandoc https://pandoc.org |"; \ echo "| exiftool https://exiftool.sourceforge.net |"; \ echo "| |"; \ - echo "| Aliases to consider: |"; \ + echo "| Aliases to consider for interactive searching: |"; \ echo "| alias uq = 'ug -Q' |"; \ echo "| alias uz = 'ug -z' |"; \ echo "| alias ux = 'ug -U --hexdump' |"; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/Makefile.in new/ugrep-7.8.1/Makefile.in --- old/ugrep-7.8.0/Makefile.in 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/Makefile.in 2026-05-03 14:44:56.000000000 +0200 @@ -1069,7 +1069,7 @@ echo "| pandoc https://pandoc.org |"; \ echo "| exiftool https://exiftool.sourceforge.net |"; \ echo "| |"; \ - echo "| Aliases to consider: |"; \ + echo "| Aliases to consider for interactive searching: |"; \ echo "| alias uq = 'ug -Q' |"; \ echo "| alias uz = 'ug -z' |"; \ echo "| alias ux = 'ug -U --hexdump' |"; \ Binary files old/ugrep-7.8.0/bin/win32/ug.exe and new/ugrep-7.8.1/bin/win32/ug.exe differ Binary files old/ugrep-7.8.0/bin/win32/ugrep-indexer.exe and new/ugrep-7.8.1/bin/win32/ugrep-indexer.exe differ Binary files old/ugrep-7.8.0/bin/win32/ugrep.exe and new/ugrep-7.8.1/bin/win32/ugrep.exe differ Binary files old/ugrep-7.8.0/bin/win64/ug.exe and new/ugrep-7.8.1/bin/win64/ug.exe differ Binary files old/ugrep-7.8.0/bin/win64/ugrep-indexer.exe and new/ugrep-7.8.1/bin/win64/ugrep-indexer.exe differ Binary files old/ugrep-7.8.0/bin/win64/ugrep.exe and new/ugrep-7.8.1/bin/win64/ugrep.exe differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/configure new/ugrep-7.8.1/configure --- old/ugrep-7.8.0/configure 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/configure 2026-05-03 14:44:56.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for ugrep 7.8.0. +# Generated by GNU Autoconf 2.72 for ugrep 7.8.1. # # Report bugs to <https://github.com/Genivia/ugrep/issues>. # @@ -606,8 +606,8 @@ # Identity of this package. PACKAGE_NAME='ugrep' PACKAGE_TARNAME='ugrep' -PACKAGE_VERSION='7.8.0' -PACKAGE_STRING='ugrep 7.8.0' +PACKAGE_VERSION='7.8.1' +PACKAGE_STRING='ugrep 7.8.1' PACKAGE_BUGREPORT='https://github.com/Genivia/ugrep/issues' PACKAGE_URL='https://ugrep.com' @@ -1383,7 +1383,7 @@ # 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 ugrep 7.8.0 to adapt to many kinds of systems. +'configure' configures ugrep 7.8.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1454,7 +1454,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ugrep 7.8.0:";; + short | recursive ) echo "Configuration of ugrep 7.8.1:";; esac cat <<\_ACEOF @@ -1632,7 +1632,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ugrep configure 7.8.0 +ugrep configure 7.8.1 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. @@ -2186,7 +2186,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ugrep $as_me 7.8.0, which was +It was created by ugrep $as_me 7.8.1, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -3696,7 +3696,7 @@ # Define the identity of the package. PACKAGE='ugrep' - VERSION='7.8.0' + VERSION='7.8.1' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -9163,16 +9163,17 @@ printf "%s\n" "$msse2_ok" >&6; } if test "x$msse2_ok" = "xyes"; then SIMD_FLAGS="-msse2 -DHAVE_SSE2" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --disable-avx" >&5 -printf %s "checking for --disable-avx... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --disable-avx2" >&5 +printf %s "checking for --disable-avx2... " >&6; } if ! test "x$with_no_avx2" = "xyes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports AVX2/AVX512BW intrinsics" >&5 printf %s "checking whether ${CXX} supports AVX2/AVX512BW intrinsics... " >&6; } save_CXXFLAGS=$CXXFLAGS - CXXFLAGS="-mavx512bw" - if test "$cross_compiling" = yes + if ! test "x$with_no_avx512" = "xyes"; then + CXXFLAGS="-mavx512bw" + if test "$cross_compiling" = yes then : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} @@ -9202,10 +9203,47 @@ esac fi - if test "x$mavx_ok" = "xyes"; then - SIMD_FLAGS="-msse2 -DHAVE_AVX512BW" - SIMD_AVX2_FLAGS="-mavx2" - SIMD_AVX512BW_FLAGS="-mavx512bw" + if test "x$mavx_ok" = "xyes"; then + SIMD_FLAGS="-msse2 -DHAVE_AVX512BW" + SIMD_AVX2_FLAGS="-mavx2" + SIMD_AVX512BW_FLAGS="-mavx512bw" + else + CXXFLAGS="-mavx2" + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <immintrin.h> +int +main (void) +{ +__m256i n = _mm256_set1_epi8(42); (void)_mm256_movemask_epi8(_mm256_and_si256(n, n)); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + mavx_ok=yes +else case e in #( + e) mavx_ok=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + if test "x$mavx_ok" = "xyes"; then + SIMD_FLAGS="-msse2 -DHAVE_AVX2" + SIMD_AVX2_FLAGS="-mavx2" + fi + fi else CXXFLAGS="-mavx2" if test "$cross_compiling" = yes @@ -11875,7 +11913,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ugrep $as_me 7.8.0, which was +This file was extended by ugrep $as_me 7.8.1, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11948,7 +11986,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -ugrep config.status 7.8.0 +ugrep config.status 7.8.1 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/configure.ac new/ugrep-7.8.1/configure.ac --- old/ugrep-7.8.0/configure.ac 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/configure.ac 2026-05-03 14:44:56.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT([ugrep],[7.8.0],[https://github.com/Genivia/ugrep/issues],[ugrep],[https://ugrep.com]) +AC_INIT([ugrep],[7.8.1],[https://github.com/Genivia/ugrep/issues],[ugrep],[https://ugrep.com]) AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip]) AC_CONFIG_HEADERS([config.h]) AC_COPYRIGHT([Copyright (C) 2019-2026 Robert van Engelen, Genivia Inc.]) @@ -210,22 +210,33 @@ AC_MSG_RESULT($msse2_ok) if test "x$msse2_ok" = "xyes"; then SIMD_FLAGS="-msse2 -DHAVE_SSE2" - AC_MSG_CHECKING(for --disable-avx) + AC_MSG_CHECKING(for --disable-avx2) if ! test "x$with_no_avx2" = "xyes"; then AC_MSG_RESULT(no) AC_MSG_CHECKING([whether ${CXX} supports AVX2/AVX512BW intrinsics]) save_CXXFLAGS=$CXXFLAGS - CXXFLAGS="-mavx512bw" - AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <immintrin.h>]],[[__m512i n = _mm512_set1_epi8(42); (void)_mm512_cmpeq_epi8_mask(n, n);]])], - [mavx_ok=yes], - [mavx_ok=no]) - if test "x$mavx_ok" = "xyes"; then - SIMD_FLAGS="-msse2 -DHAVE_AVX512BW" - SIMD_AVX2_FLAGS="-mavx2" - SIMD_AVX512BW_FLAGS="-mavx512bw" + if ! test "x$with_no_avx512" = "xyes"; then + CXXFLAGS="-mavx512bw" + AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <immintrin.h>]], [[__m512i n = _mm512_set1_epi8(42); (void)_mm512_cmpeq_epi8_mask(n, n);]])], + [mavx_ok=yes], + [mavx_ok=no]) + if test "x$mavx_ok" = "xyes"; then + SIMD_FLAGS="-msse2 -DHAVE_AVX512BW" + SIMD_AVX2_FLAGS="-mavx2" + SIMD_AVX512BW_FLAGS="-mavx512bw" + else + CXXFLAGS="-mavx2" + AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <immintrin.h>]], [[__m256i n = _mm256_set1_epi8(42); (void)_mm256_movemask_epi8(_mm256_and_si256(n, n));]])], + [mavx_ok=yes], + [mavx_ok=no]) + if test "x$mavx_ok" = "xyes"; then + SIMD_FLAGS="-msse2 -DHAVE_AVX2" + SIMD_AVX2_FLAGS="-mavx2" + fi + fi else CXXFLAGS="-mavx2" - AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <immintrin.h>]],[[__m256i n = _mm256_set1_epi8(42); (void)_mm256_movemask_epi8(_mm256_and_si256(n, n));]])], + AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <immintrin.h>]], [[__m256i n = _mm256_set1_epi8(42); (void)_mm256_movemask_epi8(_mm256_and_si256(n, n));]])], [mavx_ok=yes], [mavx_ok=no]) if test "x$mavx_ok" = "xyes"; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/include/reflex/absmatcher.h new/ugrep-7.8.1/include/reflex/absmatcher.h --- old/ugrep-7.8.0/include/reflex/absmatcher.h 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/include/reflex/absmatcher.h 2026-05-03 14:44:56.000000000 +0200 @@ -127,12 +127,12 @@ static const int EOB = EOF; ///< end of buffer meta-char marker static const size_t BLOCK = 4096; ///< minimum remaining unused space in the buffer, to prevent excessive shifting #ifndef REFLEX_BUFSZ - static const size_t BUFSZ = (256*1024); ///< initial buffer size, at least 4096 bytes + static const size_t BUFSZ = (256*1024); ///< initial buffer size, at least 4096 bytes, doubling in size to grow #else static const size_t BUFSZ = REFLEX_BUFSZ; #endif #ifndef REFLEX_BOLSZ - static const size_t BOLSZ = BUFSZ; ///< max begin of line size till match to retain in memory by growing the buffer + static const size_t BOLSZ = (256*1024*1024); ///< max (begin of) line size till match to retain, truncate lines otherwise #else static const size_t BOLSZ = REFLEX_BOLSZ; #endif @@ -488,10 +488,10 @@ evh_ = handler; } /// Invoke handler explicitly (externally) with zero shift distance. - inline void handle() + inline void handle(size_t gap = 0) { - if (evh_) - (*evh_)(*this, buf_, 0, num_); + if (evh_ != NULL) + (*evh_)(*this, buf_, gap, num_); } /// Set reserved bytes for buffer shifting inline void set_reserve(size_t n) @@ -1143,9 +1143,9 @@ { return txt_ >= buf_ + len ? txt_ - len : buf_; } - /// Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size, DANGER: invalidates previous bol() and text() pointers, use fetch() before bol(), text(), begin(), and end() when those are used. + /// Return number of bytes available after the match position given len bytes to fetch ahead, limited by input size and buffer size, DANGER: invalidates previous bol() and text() pointers, use fetch() before bol(), text(), begin(), and end() when those are used. inline size_t fetch(size_t len) - /// @returns number of bytes available after fetching. + /// @returns number of bytes available after fetching after the match position. { DBGLOG("AbstractMatcher::fetch(%zu)", len); if (eof_) @@ -1159,9 +1159,27 @@ end_ += get(buf_ + end_, len); return end_ - pos_; } - /// Returns the number of bytes in the buffer available to search from the current begin()/text() position. - inline size_t avail() + /// Returns the number of bytes in the buffer available to search from the current begin()/text() position, when not yet available, read more input to make len bytes available when specified and when the input is large enough. + inline size_t avail(size_t len = 0) { + if (len > 0) + { + // make len bytes of input available in the buffer to use, when possible + while (true) + { + size_t have = end_ - (txt_ - buf_); + if (have >= len || eof_) + return have; + size_t need = len - have; + if (end_ + need + 1 > max_) + (void)grow(end_ + need + 1 - max_); + size_t n = get(buf_ + end_, need); + if (n == 0) + eof_ = !wrap(); + else + end_ += n; + } + } if (peek() == EOF) return 0; return end_ - (txt_ - buf_); @@ -1439,7 +1457,7 @@ #if WITH_SPAN (void)lineno(); cno_ = 0; - if (bol_ + Const::BOLSZ - buf_ < txt_ - bol_) + if (txt_ > bol_ + Const::BOLSZ) { // this line is too long, shift all the way to the match instead of to the begin of the last line DBGLOG("Line in buffer is too long to shift, moving bol position to text match position"); @@ -1452,8 +1470,7 @@ // keep reserved bytes before the current line in the buffer, when nonzero (default is zero) gap -= res_; // invoke user-defined handler when defined - if (evh_ != NULL) - (*evh_)(*this, buf_, gap, num_); + handle(gap); // update state and shift cur_ -= gap; ind_ -= gap; @@ -1472,13 +1489,15 @@ else { size_t newmax = end_ + need; - // adjust max to ignore last byte + // readjust max to power of 2 (ignore last +1 byte) --max_; while (max_ < newmax) max_ *= 2; - // adjust max to add byte for a terminating \0 + // adjust max +1 byte for a terminating \0 ++max_; DBGLOG("Expand buffer to %zu bytes", max_); + // invoke user-defined handler when defined + handle(); #if WITH_REALLOC #if defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(__BORLANDC__) char *newbuf = static_cast<char*>(_aligned_realloc(static_cast<void*>(buf_), max_, 4096)); @@ -1669,7 +1688,7 @@ const char *cpb_; ///< column pointer in buffer, updated when counting column numbers with columno() #endif size_t cno_; ///< column number count (cached) - size_t num_; ///< character count of the input till bol_ + size_t num_; ///< number of bytes shifted out so far, when buffer shifted size_t res_; ///< reserve bytes to keep in the buffer before bol_ when shifting bool own_; ///< true if AbstractMatcher::buf_ was allocated and should be deleted bool eof_; ///< input has reached EOF diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/man/ug.1 new/ugrep-7.8.1/man/ug.1 --- old/ugrep-7.8.0/man/ug.1 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/man/ug.1 2026-05-03 14:44:56.000000000 +0200 @@ -1,4 +1,4 @@ -.TH UGREP "1" "April 29, 2026" "ugrep 7.8.0" "User Commands" +.TH UGREP "1" "May 03, 2026" "ugrep 7.8.1" "User Commands" .SH NAME \fBugrep\fR, \fBug\fR -- file pattern searcher .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/man/ugrep-indexer.1 new/ugrep-7.8.1/man/ugrep-indexer.1 --- old/ugrep-7.8.0/man/ugrep-indexer.1 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/man/ugrep-indexer.1 2026-05-03 14:44:56.000000000 +0200 @@ -1,4 +1,4 @@ -.TH UGREP-INDEXER "1" "April 29, 2026" "ugrep-indexer 7.8.0" "User Commands" +.TH UGREP-INDEXER "1" "May 03, 2026" "ugrep-indexer 7.8.1" "User Commands" .SH NAME \fBugrep-indexer\fR -- file indexer to accelerate recursive searching .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/man/ugrep.1 new/ugrep-7.8.1/man/ugrep.1 --- old/ugrep-7.8.0/man/ugrep.1 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/man/ugrep.1 2026-05-03 14:44:56.000000000 +0200 @@ -1,4 +1,4 @@ -.TH UGREP "1" "April 29, 2026" "ugrep 7.8.0" "User Commands" +.TH UGREP "1" "May 03, 2026" "ugrep 7.8.1" "User Commands" .SH NAME \fBugrep\fR, \fBug\fR -- file pattern searcher .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/src/query.cpp new/ugrep-7.8.1/src/query.cpp --- old/ugrep-7.8.0/src/query.cpp 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/src/query.cpp 2026-05-03 14:44:56.000000000 +0200 @@ -887,13 +887,6 @@ VKey::cleanup(); Screen::cleanup(); - // check TTY a final time for color support to print results, if any, this time without --query - flag_query = false; - terminal(); - - // print the selected output - print(); - // close the search pipe to terminate the search threads, if still open if (!eof_) { @@ -916,6 +909,13 @@ stdin_stop = true; if (stdin_thread_.joinable()) stdin_thread_.join(); + + // check TTY a final time for color support to print results, if any, this time without --query + flag_query = false; + terminal(); + + // print the selected output + print(); } // run the query UI @@ -1153,15 +1153,15 @@ } break; - case VKey::UP: // SHIFT-UP/CTRL-UP: scroll half page up + case VKey::UP: // SHIFT-UP/CTRL-UP: scroll half a page up pgup(true); break; - case VKey::DOWN: // SHIFT-DOWN/CTRL-DOWN: scroll half page down + case VKey::DOWN: // SHIFT-DOWN/CTRL-DOWN: scroll half a page down pgdn(true); break; - case VKey::LEFT: // SHIFT-LEFT/CTRL-LEFT: pan hald a page left + case VKey::LEFT: // SHIFT-LEFT/CTRL-LEFT: pan half a page left if (mode_ == Mode::QUERY) { skip_ -= Screen::cols / 2; @@ -1175,7 +1175,7 @@ } break; - case VKey::RIGHT: // SHIFT-RIGHT/CTRL-RIGHT: pan hald a page right + case VKey::RIGHT: // SHIFT-RIGHT/CTRL-RIGHT: pan half a page right if (mode_ == Mode::QUERY) { skip_ += Screen::cols / 2; @@ -1356,7 +1356,7 @@ case VKey::CTRL_Q: // CTRL-Q: immediately quit and output lines return; - case VKey::CTRL_S: // CTRL=S: scroll to next file or directory (with -l or -c) or context with -ABC + case VKey::CTRL_S: // CTRL-S: scroll to next file or directory (with -l or -c) or context with -ABC next(); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/src/ugrep-indexer.cpp new/ugrep-7.8.1/src/ugrep-indexer.cpp --- old/ugrep-7.8.0/src/ugrep-indexer.cpp 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/src/ugrep-indexer.cpp 2026-05-03 14:44:56.000000000 +0200 @@ -30,12 +30,12 @@ @file ugrep-indexer.cpp @brief file system indexer for the ugrep search utility @author Robert van Engelen - [email protected] -@copyright (c) 2023-2025 Robert van Engelen, Genivia Inc. All rights reserved. +@copyright (c) 2023-2026 Robert van Engelen, Genivia Inc. All rights reserved. @copyright (c) BSD-3 License - see LICENSE.txt */ // DO NOT ALTER THIS LINE: updated by makemake.sh and we need it physically here for MSVC++ build from source -#define UGREP_VERSION "7.8.0" +#define UGREP_VERSION "7.8.1" // use a task-parallel thread to decompress the stream into a pipe to search, also handles nested archives #define WITH_DECOMPRESSION_THREAD diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/src/ugrep.cpp new/ugrep-7.8.1/src/ugrep.cpp --- old/ugrep-7.8.0/src/ugrep.cpp 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/src/ugrep.cpp 2026-05-03 14:44:56.000000000 +0200 @@ -30,7 +30,7 @@ @file ugrep.cpp @brief file pattern searcher @author Robert van Engelen - [email protected] -@copyright (c) 2019-2025, Robert van Engelen, Genivia Inc. All rights reserved. +@copyright (c) 2019-2026, Robert van Engelen, Genivia Inc. All rights reserved. @copyright (c) BSD-3 License - see LICENSE.txt User manual: @@ -4016,8 +4016,8 @@ // initial part of a file is binary bool init_is_binary() { - // check buffer for binary data, the buffer is a 256K window over the input file - size_t avail = matcher->avail(); + // check initial input for binary data, fill up to 131072 bytes to check (similar GNU grep, but a bit more) + size_t avail = matcher->avail(reflex::AbstractMatcher::Const::BUFSZ); if (avail == 0) return false; @@ -4961,10 +4961,37 @@ ++lineno; } - // clear flags that don't make sense for config, confusing - flag_save_config = NULL; - flag_query = false; + // clear flags that don't make sense for config, clashing and confusing to allow + flag_any_line = false; + flag_basic_regexp = false; + flag_bool = false; + flag_count = false; + flag_file.clear(); + flag_files_with_matches = false; + flag_files_without_match = false; + flag_fixed_strings = false; + flag_from.clear(); + flag_fuzzy = 0; + flag_invert_match = false; + flag_line_regexp = false; + flag_match = false; + flag_max_count = 0; + flag_max_files = 0; + flag_max_line = 0; + flag_max_size = 0; + flag_min_line = 0; + flag_min_size = 0; + flag_only_line_number = false; + flag_only_matching = false; flag_pager = NULL; + flag_perl_regexp = false; + flag_query = false; + flag_quiet = false; + flag_regexp.clear(); + flag_replace = NULL; + flag_save_config = NULL; + flag_text = false; + flag_word_regexp = false; if (wdir) { flag_view = NULL; @@ -5041,7 +5068,8 @@ fprintf(file, "\ #\n\ # A long option is defined per line with an optional `=' and its argument,\n\ -# when applicable. Empty lines and lines starting with a `#' are ignored.\n\ +# when applicable. Options that change patterns and search modes are ignored.\n\ +# Empty lines and lines starting with a `#' are ignored.\n\ #\n\ # Try `ug --help' or `ug --help WHAT' for help with options.\n\n"); @@ -5134,22 +5162,6 @@ if (flag_hexdump != NULL) fprintf(file, "# Hex dump (columns, no space breaks, no character column, no hex spacing)\nhexdump=%s\n\n", flag_hexdump); - if (flag_any_line) - { - fprintf(file, "# Display any line as context\nany-line\n\n"); - } - else if (flag_after_context > 0 && flag_before_context == flag_after_context) - { - fprintf(file, "# Display context lines\ncontext=%zu\n\n", flag_after_context); - } - else - { - if (flag_after_context > 0) - fprintf(file, "# Display lines after context\nafter-context=%zu\n\n", flag_after_context); - if (flag_before_context > 0) - fprintf(file, "# Display lines before context\nbefore-context=%zu\n\n", flag_before_context); - } - if (flag_group_separator == NULL) fprintf(file, "# Disable group separator for contexts\nno-group-separator\n\n"); else if (strcmp(flag_group_separator, "--") != 0) @@ -11922,8 +11934,10 @@ { if (restline_data != NULL) { + if (restline_last + restline_size > first) + restline_size = first - restline_last; out.str(color_sl); - out.str(restline_data, first - restline_last); + out.str(restline_data, restline_size); out.str(color_off); } @@ -12424,7 +12438,11 @@ if (binary) { if (restline_data != NULL) - out.dump.hex(v_hex_line, restline_last, restline_data, first - restline_last); + { + if (restline_last + restline_size > first) + restline_size = first - restline_last; + out.dump.hex(v_hex_line, restline_last, restline_data, restline_size); + } out.dump.hex(v_hex_match, first, begin, size); } @@ -12432,8 +12450,10 @@ { if (restline_data != NULL) { + if (restline_last + restline_size > first) + restline_size = first - restline_last; out.str(v_color_sl); - out.str(restline_data, first - restline_last); + out.str(restline_data, restline_size); out.str(color_off); } @@ -12809,15 +12829,24 @@ if (binary) { if (restline_data != NULL) - out.dump.hex(Output::Dump::HEX_LINE, restline_last, restline_data, first - restline_last); + { + if (restline_last + restline_size > first) + restline_size = first - restline_last; + out.dump.hex(Output::Dump::HEX_LINE, restline_last, restline_data, restline_size); + } out.dump.hex(Output::Dump::HEX_MATCH, first, begin, size); } else { - out.str(color_sl); - out.str(restline_data, first - restline_last); - out.str(color_off); + if (restline_data != NULL) + { + if (restline_last + restline_size > first) + restline_size = first - restline_last; + out.str(color_sl); + out.str(restline_data, restline_size); + out.str(color_off); + } if (flag_replace != NULL) { @@ -13240,13 +13269,17 @@ { if (restline_data != NULL) out.dump.hex(Output::Dump::HEX_CONTEXT_LINE, restline_last, restline_data, first - restline_last); + out.dump.hex(Output::Dump::HEX_CONTEXT_MATCH, first, begin, size); } else { - out.str(color_cx); - out.str(restline_data, first - restline_last); - out.str(color_off); + if (restline_data != NULL) + { + out.str(color_cx); + out.str(restline_data, first - restline_last); + out.str(color_off); + } if (flag_replace != NULL) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ugrep-7.8.0/src/ugrep.hpp new/ugrep-7.8.1/src/ugrep.hpp --- old/ugrep-7.8.0/src/ugrep.hpp 2026-04-29 16:27:56.000000000 +0200 +++ new/ugrep-7.8.1/src/ugrep.hpp 2026-05-03 14:44:56.000000000 +0200 @@ -30,7 +30,7 @@ @file ugrep.hpp @brief file pattern searcher @author Robert van Engelen - [email protected] -@copyright (c) 2019-2025, Robert van Engelen, Genivia Inc. All rights reserved. +@copyright (c) 2019-2026, Robert van Engelen, Genivia Inc. All rights reserved. @copyright (c) BSD-3 License - see LICENSE.txt */ @@ -38,7 +38,7 @@ #define UGREP_HPP // DO NOT ALTER THIS LINE: updated by makemake.sh and we need it physically here for MSVC++ build from source -#define UGREP_VERSION "7.8.0" +#define UGREP_VERSION "7.8.1" // disable mmap because mmap is almost always slower than the file reading speed improvements since 3.0.0 #define WITH_NO_MMAP ++++++ ugrep.obsinfo ++++++ --- /var/tmp/diff_new_pack.Iz0p7T/_old 2026-05-04 12:57:30.263325889 +0200 +++ /var/tmp/diff_new_pack.Iz0p7T/_new 2026-05-04 12:57:30.271326218 +0200 @@ -1,5 +1,5 @@ name: ugrep -version: 7.8.0 -mtime: 1777472876 -commit: 5f6f5bd4f77df74faf01076f7d2407a603464868 +version: 7.8.1 +mtime: 1777812296 +commit: 0ecc0aa45ad7b327a857cd90d5ec77501edae4b6
