Skip to content

Commit

Permalink
released 4.5.1 fix bzip3/7zip configure interference
Browse files Browse the repository at this point in the history
  • Loading branch information
genivia-inc committed Jan 6, 2024
1 parent 7f18bb9 commit 68ea92a
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5353,7 +5353,7 @@ in markdown:



ugrep 4.5.0 January 5, 2024 UGREP(1)
ugrep 4.5.1 January 6, 2024 UGREP(1)

🔝 [Back to table of contents](#toc)

Expand Down
Binary file modified bin/win32/ug.exe
Binary file not shown.
Binary file modified bin/win32/ugrep.exe
Binary file not shown.
Binary file modified bin/win64/ug.exe
Binary file not shown.
Binary file modified bin/win64/ugrep.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion man/ugrep.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH UGREP "1" "January 05, 2024" "ugrep 4.5.0" "User Commands"
.TH UGREP "1" "January 06, 2024" "ugrep 4.5.1" "User Commands"
.SH NAME
\fBugrep\fR, \fBug\fR -- file pattern searcher
.SH SYNOPSIS
Expand Down
20 changes: 14 additions & 6 deletions src/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1243,14 +1243,22 @@ bool Output::format(const char *format, const char *pathname, const std::string&
break;

case 'Z':
if (flag_fuzzy > 0 && !flag_match)
if (flag_fuzzy > 0)
{
// -Z: we used the fuzzy matcher to search, so a dynamic cast is fine
reflex::FuzzyMatcher *fuzzy_matcher = dynamic_cast<reflex::FuzzyMatcher*>(matcher);
if (!flag_files_with_matches && !flag_count)
num(fuzzy_matcher->edits());
if (!flag_match)
{
// -Z: we used the fuzzy matcher to search, so a dynamic cast is fine
reflex::FuzzyMatcher *fuzzy_matcher = dynamic_cast<reflex::FuzzyMatcher*>(matcher);
if (!flag_files_with_matches && !flag_count)
num(fuzzy_matcher->edits());
else
num(fuzzy_matcher->distance() & 0xff);
}
else
num(fuzzy_matcher->distance() & 0xff);
{
// --match all
chr('0');
}
}
break;

Expand Down
2 changes: 1 addition & 1 deletion src/ugrep.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define UGREP_HPP

// ugrep version
#define UGREP_VERSION "4.5.0"
#define UGREP_VERSION "4.5.1"

// disable mmap because mmap is almost always slower than the file reading speed improvements since 3.0.0
#define WITH_NO_MMAP
Expand Down
Binary file added tests/archive.7z
Binary file not shown.
Binary file modified tests/archive.gz
Binary file not shown.
Binary file modified tests/archive.tar.zip
Binary file not shown.
Binary file modified tests/archive.tgz
Binary file not shown.
Binary file modified tests/archive2.tgz
Binary file not shown.
Binary file modified tests/archive3.tgz
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ brotli -9 -c archive.tar > archive.tar.br
bzip3 -c archive.tar > archive.tar.bz3
zip -9 -q archive.tar.zip archive.tar
zip -9 -q archive.zip $FILES
7z a archive.7z $FILES > /dev/null

tar cfz archive2.tgz archive.tar $FILES archive.tgz
tar cfz archive3.tgz archive.tgz $FILES archive2.tgz
Expand All @@ -171,6 +172,7 @@ $UG -z -c Hello archive.tgz > out/archive.tgz.out
$UG -z -c Hello archive.tZ > out/archive.tZ.out
$UG -z -c Hello archive.tar.zip > out/archive.tar.zip.out
$UG -z -c Hello archive.zip > out/archive.zip.out
$UG -z -c Hello archive.7z > out/archive.7z.out
$UG -z -c Hello archive.tbz > out/archive.tbz.out
$UG -z -c Hello archive.tlz > out/archive.tlz.out
$UG -z -c Hello archive.txz > out/archive.txz.out
Expand All @@ -186,6 +188,7 @@ $UG -z -c -tShell Hello archive.tgz > out/archive-t.tgz.out
$UG -z -c -tShell Hello archive.tZ > out/archive-t.tZ.out
$UG -z -c -tShell Hello archive.tar.zip > out/archive-t.tar.zip.out
$UG -z -c -tShell Hello archive.zip > out/archive-t.zip.out
$UG -z -c -tShell Hello archive.7z > out/archive-t.7z.out
$UG -z -c -tShell Hello archive.tbz > out/archive-t.tbz.out
$UG -z -c -tShell Hello archive.tlz > out/archive-t.tlz.out
$UG -z -c -tShell Hello archive.txz > out/archive-t.txz.out
Expand Down
Empty file added tests/out/archive-t.7z.out
Empty file.
8 changes: 8 additions & 0 deletions tests/out/archive.7z.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
archive.7z{empty.txt}:0
archive.7z{Hello.bat}:1
archive.7z{Hello.class}:1
archive.7z{Hello.java}:2
archive.7z{Hello.pdf}:1
archive.7z{Hello.sh}:1
archive.7z{Hello.txt}:1
archive.7z{emptyline.txt}:0
4 changes: 4 additions & 0 deletions tests/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ printf .
$UG -z -c Hello archive.tar.zip | $DIFF out/archive.tar.zip.out || ERR "-z -c Hello archive.tar.zip"
printf .
$UG -z -c Hello archive.zip | $DIFF out/archive.zip.out || ERR "-z -c Hello archive.zip"
printf .
$UG -z -c Hello archive.7z | $DIFF out/archive.7z.out || ERR "-z -c Hello archive.7z"
if [ "$have_libbz2" == yes ]; then
printf .
$UG -z -c Hello archive.tbz | $DIFF out/archive.tbz.out || ERR "-z -c Hello archive.tbz"
Expand Down Expand Up @@ -427,6 +429,8 @@ printf .
$UG -z -c -tShell Hello archive.tar.zip | $DIFF out/archive-t.tar.zip.out || ERR "-z -c -tShell Hello archive.tar.zip"
printf .
$UG -z -c -tShell Hello archive.zip | $DIFF out/archive-t.zip.out || ERR "-z -c -tShell Hello archive.zip"
printf .
$UG -z -c -tShell Hello archive.7z | $DIFF out/archive-t.7z.out || ERR "-z -c -tShell Hello archive.7z"
if [ "$have_libbz2" == yes ]; then
printf .
$UG -z -c -tShell Hello archive.tbz | $DIFF out/archive-t.tbz.out || ERR "-z -c -tShell Hello archive.tbz"
Expand Down

0 comments on commit 68ea92a

Please sign in to comment.